I am making a simple script for a rig and I want to display the X rotation_euler axis of a bone as a single property in the UI.
The issue that I have is two fold, first:
I want it as a slider “slider=True” with the min being -90 and max being +90, but how do I set this without creating a custom property? the bones defult min/max is 10,000.00 can this be changed? or can I define a min max for a slider separate to the property?
Secondly:
How do I display this property as a single property, Its part of a FloatVectorProperty so whenever I try to display it in the ui it has the Y & Z axis as well. Is it possible to display only one value from a VectorProperty?
I have looked at creating a custom property with a min and max value and it displays correctly, but trying to use that instead of the Xaxis causes loads of problems for the animator so the prop in the ui needs to be the same as the actual Xaxis prop for keying purposes.
I have used the update callback, the issue is that the animator wants to be able to add keys via the property ui and do other stuff that requires it to be the Xaxis like see the keyframe color indication. I could just override the Xaxis with a driver connected to the custom property and use that for animation, but then that would cause a lot of other issues.
Is there no way to display a slider with a custom range or limit? I remember reading some were about getting a property to display like another property? but cant seem to find that info, might be mad
Well, you can add a single driver to x rotation and set the scripted expression to the full path of an armature object’s pose bone and give it an ID property. This can be done in the UI, bone tab in properties editor, custom properties panel. You can click “edit” and change the boundaries.
This is not ideal because its really ugly, I could live with it if I could get rig of one of the number readouts, either have the slider not display a number or have the Xaxis prop display an icon? I don’t know though.
The other solution is that I try and recreate all of the feedback/interaction that the animator wants ie key-frame indication and add a “add/remove keyframe” button:
Just been looking into the whole star idea a bit more.
I could just have a gold star for when a key-frame is on that frame and have it like a toggle, so that the feedback could also double as an input. ie the animator could toggle on the star to add a key-frame or toggle off the star to delete a key-frame.
Hmm. adding a key-frame to a single fcurve at a certain frame is easy but how do you determine that there is or is not already a key-frame on that fcurve at that frame?