Page 1 of 3

Attribute Spreadsheet

Posted: Tue Dec 08, 2020 1:58 pm
by Movalex
One of my favorite tools, Attribute Spreadsheet, was written by @svenneve in 2013. I did not find any traces of it to be updated to support the latest Fusion and Resolve versions, and it looks like to be abandoned for 7 years now. This is my attempt of reviving this tool while adding new features to it.

Screenshot 2020-12-08 004653.png

AttributeSpreadsheet is a spreadsheet script to edit the input parameters of multiple Fusion tools at once. It is extremely useful for batch tool changes, and a great help for any motion graphics tasks. The most amazing part that it works with any native or third party Fusion tool, such as OFX plugins, macros, Krokodove tools and so on. Any available input is accessible from a very convenient table view. You can link any input to another with expression by a middle mouse drag. Some tools, such at Text+ Font or Style, does not even allow setting expression manually. With Attribute Spreadsheet you can do that too. As far as I know, this is the fastest, and the most reliable tool for a batch changing parameters or linking multiple Fusion inputs.

Requirements:
  • Python 3.6
  • Fusion Standalone v.9 and v.16+, Davinci Resolve v.16+
  • PySide2 (can be installed automatically)
Usage:
  • Select one or more tools in Fusion flow and start the script or press "Refresh" button if already started.
  • Select multiple values in a single column, say, "Blend".
  • Start typing new numeric value and hit Enter. All Blend values for selected tools will be changed accordingly. That's the basic functionality.
  • To link multiple tool's inputs to another tool with expression, select the column and drag with middle-click towards the cell you are linking to.
  • Enter -x to discard the expression on single or multiple inputs. Once the expression is set, you cannot change the values in the table unless the expression is cleared.
  • Use +=, -=, *=, /= and %= to do mathematical expressions with current numerical values. for example: enter +=0.2123 to default Transform Size value, and it will become 1.2123
  • Use search bar to find inputs. You can search for multiple inputs, separated by spaces, like size angle to search both Size and Angle inputs.
  • Enter numerical values or expression to point values, such as Pivot or Center. For instance, enter =time in the Transform Angle cell will create =time expression, adding =time and 0.35 in Center X and Y values will create Point(time, 0.35) expression.
  • Enter p in any table cell and all corresponding input attributes will be listed in Console.
  • Click on the row header (tool name) to activate the tool.
  • Click on column header to sort inputs alphabetically. Click on the corner button to reset sorting to default state.
The current version has quite large changelog in comparison to the last known version of hos_AttributeSpreadsheet. You can find full list of new features and fixes inside a script file. The most significant improvements:
  • Point data with X and Y elements are both adjustable and now work with mathematical modifiers.
  • You can add expressions to Point data values, such as Point(Pivot.X, 0.5)
  • Corner button will reset sorting to default state
  • Tool name and ID is added to a table to improve sorting abilities
  • Added logging, most errors are caught with Console feedback
  • Set active tool by clicking on row header
  • Use this script as a standalone tool (Fusion Studio feature). Provide a remote machine IP as an argument to a script to do remote management
Automatic PySide2 installation

My intention was to make this script as straightforward and easy to use as possible. Usually installing third party package to Python is a painless task. But we can go further and strip this step, offering automatic PySide2 installation on a first launch.
If Pyside2 is not found on the computer, the script will show a dialogue, whether you want to install the package automatically. If clicked Ok, it attempts to install Pyside2 using standard pip tools. Otherwise, the command for manual installation will be shown in Console. Python modules manager pip should be already installed on the computer. Pip is a part of standard Python3 installation, thus the script will require Python3 (also for maintenance purposes). Automatic PySide2 installation process will be visible in Fusion console. If you don't want automatic installation or the installation process fails for some reason, try installing manually by typing python -m pip install Pyside2 in Command prompt on Windows or python3 -m pip install Pyside2 in Terminal on Mac. Once Pyside2 is installed, launch the script again and UI will appear.

Known issues:
  • You should avoid linking inputs to each other. This is a known bug: if you link Transform1.Size to Transform2.Size and then try to link expression from Transform2.Size back to Transform1.Size, Fusion will crash immediately. The same will happen if you try to do that with a script. Just don't.
TODO:
  • All fields except numerical or point data inputs are treated as text values. This prevents unexpected behavior when changing cells values. However it is possible to add combobox (dropdown menu) to the inputs with list data, such as INPIDT_ComboControl_ID or INPIDT_MultiButtonControl_ID, so you could choose the appropriate values from a dropdown list instead of typing values manually. This can be tricky, because some Fusion inputs addressed by key ('1.0', '2.0') and some - by value ('Red', 'XYZ' etc). Also, this should probably exclude Fonts.
  • Add a completer with the most commonly used search commands. For instance, if you've already been searching red green blue, this query will be suggested once you type r in search area.
  • Add an option for partial middle-drag/linking Point data, such as link only X values, or only Y, so the expression would be like Point(Transform1.Center.X, 0.5). Currently, it is possible by typing expression text to a Point X cell.
  • Add Select by ID button to quickly select and load to the table all tools with the same ID as the active tool. However, this can be done with ToolManager script, so questionable.
  • Please suggest any other improvements.
Take a look at this feature review made by the author of the original script. Please note that some of mentioned in the video bugs and/or features are fixed/implemented in this release. And yes, this last sentence implies that new bugs could have been implemented as well, although I did my best to avoid them. Please report any issues here.





Version: 0.2.5 - [2021/2/7]

Copyright: 2011-2013, Sven Neve (House of Secrets), 2019-2020 additions by Alexey Bogomolov (mail@abogomolov.com)

License: MIT

Donations: PayPal.me


https://gitlab.com/WeSuckLess/Reactor/- ... preadsheet
com.AlexBogomolov.AttributeSpreadsheet.zip

Re: Attribute Spreadsheet

Posted: Tue Dec 08, 2020 2:48 pm
by SecondMan
Boom, that's a BIG one @Movalex!

Available in Reactor now - please check if all works well.

And thank you! :cheer:

Re: Attribute Spreadsheet

Posted: Wed Dec 16, 2020 4:19 am
by svenneve
Hey, nice work.
Yeah, most of my tools are very much on a backburner...of a couple of years. We switched to mostly using Fusion for creating textures and quick cleanups these days (content for realtime interactive applications), so the spreadsheet tool was used less and less as we used it mostly for heavy vfx comp work back in the day.
Nice to see it being picked up by others though.

Re: Attribute Spreadsheet

Posted: Thu Dec 17, 2020 5:53 am
by maximronkin
Hey guys,

Would really love to give the script a try but get the following error when I run it:

running
Done
File "C:\ProgramData\Blackmagic Design\Fusion\Reactor\Deploy\Scripts\Comp\AttributeSpreadsheet\AttributeSpreadsheet.py", line 99
print(f"\nAttribute Spreadsheet version 0.{__VERSION__}")
^
SyntaxError: invalid syntax

I'm not big on python. Can you please tell me what should I do to make it work? I run Fusion 9.

Re: Attribute Spreadsheet

Posted: Thu Dec 17, 2020 7:30 pm
by SecondMan
Looks like you're running Python 2.7 - this script requires Python 3.6 and you need to set that as your preferred version in Fusion's preferences:

image.png

Not sure if there's a way to make Fusion switch between Python versions at the script level, and I haven't looked or tried - but that would be nice.

Re: Attribute Spreadsheet

Posted: Fri Dec 18, 2020 8:26 am
by Movalex
Hey, @maximronkin
Sorry for that, I forgot to catch Python version on the early stage. Hopefully new version will handle this nicely:

Image

Thanks, @svenneve!

Unfortunately, scrolling in the app with more than 30 tools loaded is still a bit laggy. TableModel data is being read 8 times on each table movement, and it seems hardly possible to avoid that. Also I wonder if it is possible to make progress bar work on initial launch. Currently we have to wait a bit until the data is loaded and then the UI shows. I will probably make a splash screen for that.

Here's the new version of Attribute Spreadsheet:
V.0.2.4:
  • set empty value to Text inputs, such as Comments
  • cache is enabled by default
  • catch wrong Python version early
https://gitlab.com/WeSuckLess/Reactor/- ... quests/237

Re: Attribute Spreadsheet

Posted: Fri Dec 18, 2020 10:34 am
by SecondMan
Also done! Thanks again :cheer:

Re: Attribute Spreadsheet

Posted: Wed Feb 03, 2021 7:37 pm
by poppop
In Davinci resolve 17 b8 and fusion 9
install python 3.6 and pyside2 but got this error

Attribute Spreadsheet version 0.2.4
Traceback (most recent call last):
File "C:\Users\xxxx\AppData\Roaming\Blackmagic Design\DaVinci Resolve\Support\Fusion\Scripts\Comp\AttributeSpreadsheet.py", line 134, in <module>
raise Exception("No instance of Fusion found!")
Exception: No instance of Fusion found!

Re: Attribute Spreadsheet

Posted: Sat Feb 06, 2021 2:29 am
by Movalex
@poppop Thats interesting. This is just an init message shown if the script did not found a running fusion app.
If you open Console on py3 page and run ==bmd do you have any output? It should show this: <module 'fusionscript' (built-in)>
Is it possible Fusion and Resolve are running simultaneously? Maybe any frozen Fusion processes in the Task manager?

Re: Attribute Spreadsheet

Posted: Sat Feb 06, 2021 4:25 am
by poppop
yes it show
Py3> ==bmd
<module 'fusionscript' (built-in)>

It show in both fusion page and fusion standalone
ps. I'm use resolve 17 and fusion 9 free version

Re: Attribute Spreadsheet

Posted: Sat Feb 06, 2021 5:53 am
by Movalex
I just cant figure it out, how that can possibly be... Are you running it from the Workspace -- Scripts -- AttributeSpreadsheet menu in Resolve?

Re: Attribute Spreadsheet

Posted: Sat Feb 06, 2021 6:54 am
by poppop
Image 4.png
Yes I running it from the Workspace -- Scripts -- AttributeSpreadsheet menu

Re: Attribute Spreadsheet

Posted: Sat Feb 06, 2021 7:40 am
by Movalex
Did you check for any other fusion processes hung/running? Is the issue persist after the restart/logout? Do you have any other python scripts to test? If you open the script folder and drag the .py file directly to the console, will it launch? (It should).
I've just installed the latest resolve version and it works, so that's clearly not a compatibility issue.

Re: Attribute Spreadsheet

Posted: Sat Feb 06, 2021 8:32 am
by Midgardsormr
If the path were incorrect, it couldn't raise a Fusion-aware error at all.

I'm not sure of this, but it's possible that the way you're defining fu is the problem. Remember that the free version doesn't permit remote control. That's essentially what you're doing here by connecting to the Fusion instance through bmd.scriptapp("Fusion", "localhost").

poppop, if you're comfortable modifying the script, try removing the localhost argument on line 1118. It should read:
fu = bmd.scriptapp("Fusion")

Re: Attribute Spreadsheet

Posted: Sat Feb 06, 2021 8:37 am
by JiiPii
Unfortunately, I can't get it to work either. So far, I haven't done anything with Python. I installed Python 3.6 and the Attribute Spreadsheet 0.24 from the Reactor. When running, the installation window to install PySide2 pops up, but this somehow fails. Unfortunately, I cannot change the default Python version either, because the selection is grayed out for me.

Image

Image

Then I read the post, where the PYHTONPATH is corrected. This entry was missing in my system. I added it but am getting this error:
image.png