Hello
I’m writing a script that randomizes selected keyframes depends on their min and max values (if keyframes are equal then they would not change) and a threshold bar.
this is useful especially for repeating animations like cycled animations.
you can check it on
https://github.com/snotnose/blender_rigging_scripts/blob/master/randomize_keys.py
first I would be happy if people check it and tell me what they think, but just a warning it can crash sometimes
not sure why since its relative a simple script but it seems to be related to the threshold property
now to some questions
I’m currently using property ID for the threshold that is assigned to the scene properties. I applied it outside of the classes and functions, in the beginning main part of the script, so that it won’t reset it every time i call the operator, but not sure if its a good idea. I was also wondering how can i setup the max and min values for this kind of property ID using python.
last time the script crashed blender was actually after i manually changed the min and max values in the property
I tried before that using properties inside the script operator for the UI panel instead of property IDs in the scene
something like
threshold = bpy.props.FloatProperty(name=“threshold”, description=“Threshold of keyframes”, default=0.1, min=0.0, max = 1.0) for the Randomize_Keys operator class
and then calling it from the panel using
props = layout.operator(“fcurves.random”)
layout.prop(props, “threshold”, slider = True)
but the slider on the ui was completly static and it wasn’t possible to change its value.
any ideas how to solve this, or would it be better to stay with property IDs assigned to the scene?
I noticed there are different kind of properties in blender as well as property groups, still trying to figure out their uses.
appreciate any tips
Tal