eoyilmaz / anima

VFX & Animation Pipeline Library
MIT License
137 stars 27 forks source link

__update__ for PySide2 support for nuke11 and added "from nukescripts import" #20

Closed tws0002 closed 6 years ago

eoyilmaz commented 7 years ago

Don't use from nukescripts import * it will contaminate the main namespace use import nukescripts.

tws0002 commented 7 years ago

ok I will make the change

tws0002 commented 7 years ago

but i having this error !! if not using from nukescripts import *

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File \anima\anima\ui\scripts\nuke.py", line 28, in version_creator
    set_qt_lib()
  File "\anima\anima\ui\scripts\nuke.py", line 12, in set_qt_lib
    if nuke.NUKE_VERSION_MAJOR < 10 or (nuke.NUKE_VERSION_MAJOR == 11):
AttributeError: 'module' object has no attribute 'NUKE_VERSION_MAJOR'
eoyilmaz commented 7 years ago

You should do:

import nukescripts
nukescripts.NUKE_VERSION_MAJOR  # instead of nuke.NUKE_VERSION_MAJOR
                                # nuke belongs to anima,
                                # what you should use is nukescripts
tws0002 commented 7 years ago

here is the error from nuke scripts editor

import nukescripts
nukescripts.NUKE_VERSION_MAJOR

Result

import nukescripts
nukescripts.NUKE_VERSION_MAJOR
# Result: Traceback (most recent call last):
  File "<string>", line 2, in <module>
AttributeError: 'module' object has no attribute 'NUKE_VERSION_MAJOR'
tws0002 commented 6 years ago

Hi, what do u think about this error?

eoyilmaz commented 6 years ago

I've added anima to Nuke for a very old version of Nuke (something like version 6 or 7) so it may not work with the latest Nuke versions.

But it seems a bug which is relatively easy to fix. Just find the new way of getting the current Nuke version through the nukescripts module.