-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3 Support #6
base: master
Are you sure you want to change the base?
Conversation
shiboken needs this for pointers
These are no longer supported in Python 3, and would try and import something from PYTHONPATH/sys.path rather than the local directory.
Missing from Python 3
This alias was removed from Python 3, type(None) is identical.
For Python 3
With @six.add_metaclass
For Python 3
For checking against which version is installed
For clarity, the bundled |
I also added a version.py __version_info__ = (1, 1, 0)
__version__ = ".".join(map(str, __version_info__)) |
Hello Marcus, Thanks, |
Hi Daniele! I've tested this only on Maya 2018 and 2021, and would be able to test it on Houdini 18, but would need help testing it on Nuke. Speaking of testing, how do we test? When I say "tested on Maya", I mean.. from kiko import initialize
initialize()
from kiko.apps.maya.ui import exporter
d = exporter.MayaExporterDialog()
d.show() Followed by exporting something. And then.. from kiko import initialize
initialize()
from kiko.apps.maya.ui import importer
d = importer.MayaImporterDialog()
d.show() To import it. But I noticed there are no GUIs for Houdini nor Nuke, and I just now spotted a few unit tests that cover Maya 2017 and Nuke 11; those won't work under Python 3 as-is, and would need a little push. kiko/kiko/unittests/run_win.py Lines 54 to 59 in 76ceec1
For Houdini and Nuke, would something like this suffice? from kiko.apps.houdini import manager
m = manager.HoudiniKikoManager()
m.export_to_file(
"temp.kiko",
operators=[
"CurveOperator",
"StaticOperator",
"BakeOperator",
"WorldSpaceOperator",
],
keep_previous_images=False,
hierarchy=True,
start_frame=1,
end_frame=10,
force_op_evaluation=False
)
m.import_from_file(
"temp.kiko",
import_obj_method="hierarchy",
import_anim_method="apply",
scale_using_fps=False,
frame_value=0,
ignore_item_chunks=True,
start_frame=1,
end_frame=10,
) Under Houdini 18 on Windows, this currently throws an error. Traceback (most recent call last):
File "<console>", line 13, in <module>
File "C:\github\mottosso\kiko\kiko\python\kiko\core\manager.py", line 104, in
export_to_file
k_file.save()
File "C:\github\mottosso\kiko\kiko\python\kiko\io\kikofile.py", line 106, in s
ave
self._add_to_tar_from_dict(tar_file, KIKO_FILE.METADATA, self._metadata)
File "C:\github\mottosso\kiko\kiko\python\kiko\io\kikofile.py", line 77, in _a
dd_to_tar_from_dict
json.dump(data, io)
File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.532\python27\lib\json\__init__.py", line 1
90, in dump
fp.write(chunk)
TypeError: unicode argument expected, got 'str' Would anyone be able to test on Nuke, and other versions of Maya and/or Houdini? #help |
Hi @mottosso and @danielefederico Have been watching this project for a long time, and thought this might be the chance for me to join in ! I may able to help on testing in Nuke 9-11 once I get back office. |
Thanks David and Marcus! There are some unit tests on the project for Maya and Nuke, if they don't fail everything should be good to go. To run them you can use this file: Nose is used for the unit tests. Thanks, |
So I forked this branch and run the test in Nuke, all passed Nuke 9.0v7
Nuke 11.3v4
|
Thanks David! Marcus, did you have any luck with Houdini? Thanks, |
Not yet, I expect to be back on it this weekend. |
Sorry for the delay on this one, the project I was on got postponed and I'm still waiting for it to start back up, at which point this will become relevant once again. |
Maya 2021 and friends are just around the corner, and with it comes Python 3 in full color.
This PR implements support for Python 3 in a series of hopefully self-documented commits. Most of it is self-explanatory, like
itervalues -> values
, andfrom qthandler import ...
tofrom .qthandler import ...
for relative local imports.To support metaclasses, I opted to integrate
six.py
and it's@add_metaclass
. Having worked with this before, I found it the most descriptive and hasslefree with only a minimal (bundled) dependency.Feedback
If there is one thing I'd like to direct your eyes towards it's
kikofile.py
and how I handled encoding/decoding between unicode and bytes. Unicode still eludes me to this day, so it's possible there are cases unaccounted for in this implementation.Let me know what you think!