int cast in add_dummy_markers to comply with blender python 3.1+#524
Conversation
|
This is quirky as keyframes used to be able to land between physical frames, ie. needing floats rather than ints. The code that imports markers should be checked too. |
|
Importing a nif with text keys in controllersequence wont give me any markers at all... |
|
Nvm I'm stupid, they are there just fine - I just didnt show pose markers. There already is a round statement in the code though, import_text_key_extra_data (nif_import/animation/__init__.py)has:
Seems like the cleaner fix over just int casting... Blenders bpy.types.Action's frame_range gives a [float,float] array - I think just casting these should be fine, afaik you cant set an actions start/end to sub-frame positions |
|
added fix in get_controller_data -> see comment #506 |
|
Good to merge? |
@niftools/blender-niftools-addon-reviewer
Overview
blenders python had some changes from 3.1+ that affect scripting, from docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.1/Python_API
"Python 3.10 no longer implicitly converts floats to int's (issue linked). This means functions that previously accepted float typed values will raise a type error.
Floating point arguments must now be explicitly converted to integers"
This error is encountered in add_dummy_markers in nif_export/animation/init.py
A simple int cast resolves this - don't know if similar issues exists in other parts of the code. Should be harmless?
Detailed Description
[List of functional updates]
Fixes Known Issues
None afaik
Documentation
[Overview of updates to documentation]
Testing
[Overview of testing required to ensure functionality is correctly implemented]
Manual
[Set of steps to manually verify updates are working correctly]
Automated
[List of tests run, updated or added to avoid future regressions]
Additional Information
[Anything else you deem relevant]