Git Product home page Git Product logo

fusionless's People

Contributors

bigroy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fusionless's Issues

Fusion backwards compatibility

Newer versions of Fusion come with better methods for checking the type of an object that could ease the conversion from PyObject to the correct type. But using that automatically drops support for Fusion under 7.0. Whilst at this stage 6.0+ is also supported.

I'm raising this issue here to see what other people think about how far back we want to support Fusion versions. If we choose to stay only compatible with the Black Magic Design releases of Fusion that would be 7+. Though I know some are still operating with Eyeon's 6.4 releases.

Goal

Get a feeling of the current versions being used in productions and the importance of being backwards compatible with fusionscript over time for much older versions.

Reference

This topic briefly covers the IsClassType method only available in Fusion 7+

error calling fusionless.Comp() from command line

I'm having a bit of trouble getting going from the command line inside Fusion 8.2_b2, Python2.7

import fusionless as fu
c = fu.Comp()
Traceback (most recent call last):
  File "<nofile>", line 1, in <module>
  File "C:\Python27\lib\site-packages\fusionless-master\fusionless\core.py", line 62, in __new__
    "{0}".format(type(reference).__name__))
RuntimeError: No default reference for: NoneType

Deciding on documentation style (docstrings)

Currently I'm using a heavily reStructuredText driven docstring style but looking over how it looks in the code I'm thinking about swapping over to the Google Style Docstrings.

Google Style Docstrings

reStructuredText Docstrings

The nice thing of reStructuredText over Google Style is that it's easily supported for autodoc in sphinx. Plus it's supported directly in IDEs like PyCharm while Google Style is not supported in PyCharm.

Comp FileName and saving

In a pipeline script that sets the save path for a comp, I'm trying the same syntax as setting other attributes, but the attribute doesn't get set. In the script I am porting to Fusion/fusionless from Nuke the file path gets set and the user warned if the file already exists, after which they can overwrite it, or save a different version/name.

import fusionless as fu
cmp = fu.Comp()
cmp.set_attr('COMPS_FileName','C:\Temp\Monkey_v001.comp')
if foo == True:
    cmp.save()

I can script my way around the existing behaviour, but I thought I would let you know what I am trying to do.
In a related note, I see that I have a few options for saving comps here. At first I was surprised that the fu.Comp().save() method didn't take a file path argument.
In this case the fusionscript version is pretty straight forward
comp.Save('C:\Temp\Monkeyhead_v001.comp')
and I see that this works too
fu.Comp().Save("C:\Temp\Monkey_v002.comp")

Implement managing of UserControls

Custom attributes can be added in Blackmagic Design Fusion on the tool nodes by means of "UserControls".

Without scripting these can be tweaksed with "Edit Controls.." when right clicking on the top icon bar of the tool parameters. In scripting this is an ordered dictionary under tool.UserControls.

For example:

# Set the user controls
# Note: since we're setting the dict value directly any existing user controls will be lost.
tool.UserControls = {
        "myAttribute": {
            "LINKS_Name": "Attribute Name",
            "LINKID_DataType": "Number",
            "INPID_InputControl": "CheckboxControl",
            "INP_Default": 1,
            "INP_Integer": True,
            "ICD_Width": 1.0,
            "CBC_TriState": False,
            "ICS_ControlPage": "Avalon"
    }
}

# Make sure the UI updates
tool.Refresh()

More details WeSuckLess VFXPedia User Controls.

Should work across Fusion 9, 16 and 17.

Implement AskUser dialog

Implementation

A draft implementation has been pushed just now for AskUserDialog. This is the fusionless class for Fusion's comp.AskUser. Consider it a draft implementation, so make sure to test the functionality once you start adopting it.

An example of usage is available here: https://github.com/BigRoy/fusionless/blob/master/examples/comp/ask_user_dialog.py

The resulting dialog:

ask_user_dialog

As far as I tested all functionality should work.

Discussion

I'm not too fond of how Fusion returns some of the values from the dialog.

For example a position control returns the values as {1.0: 0.5, 2.0: 0.5, 3.0: 0.5}. So basically it is a dictionary with three values (even though the control shows only X, Y). Preferably I would have it return it as a list or tuple, like (0.5, 0.5, 0.5) (for X, Y, Z if the Z-component is shown in the UI which I haven't seen yet).

Furthermore I'm opening this issue to open up discussion about the overall implementation.

Deciding on Python code style

The fusionscript packages tries to wrap all of Fusion's coding functionality in a more Pythonic manner. With that in mind I've been wrapping the methods and classes in the PEP08 code style, even though Fusion uses UpperCamelCase functions.

I just wanted to check here if anyone has anything against rewriting it so it's more Pythonic and stepping away from how Fusion does it internally. Or would we rather stick with Fusion's code style even though it's far from good-looking in terms of Python code?

Example

Fusion

class Comp(object):
    def GetAttrs(self):
        pass

More Pythonic

class Comp(object):
    def get_attrs(self):
        pass

Deciding on Licensing

I'm opening this issue to start the discussion about the preferred licensing model for the fusionscript package.

Currently I've adopted the license from Pymel as it has been adopted widely in pipelines and I haven't heard any issues about studios not adopting it because of its license. I think it's a pretty liberate and free license (plus it's super short!) so it should be fine. But I'm keeping this Issue open for some time to see where we land.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.