3
$\begingroup$

I am creating a UI for a rig and I want to have a property on a panel.

The property is a bones rotation_eular.x value and it needs to be a slider. When setting a property as a slider "slider=True" it uses the min and max values of the property to determine the range of the slider.

The problem is that a bone has no min or max values so the slider is useless.

Is there a way to either set a custom range for the slider or to set the bones rotation_eular properties min/max values?

I want the slider range to be from -90 to +90, I know I could create a custom property and then add a driver to the rotation_eular.x property but then I could not use the manipulator in 3Dview to animate it.

Any Ideas? some more info in this thread: http://www.blenderartists.org/forum/showthread.php?333659-property-ui-question

$\endgroup$
3
$\begingroup$

You can use limit constraints, the catch is that they limit visual values used but the actual values can be anything. This is only of concern if you want to access the values in python.

enter image description here

So while your slider will continue to display large rotation values like 1346 degrees the bone will only be rotated between -90 and 90 degrees visually.

If you setup a driver to use the rotation value of the bone then it will just work, the driven value will be within the limit rotation values.

enter image description here

If you want to access the rotation value within python then you should manually apply any limits to the value before using it.

$\endgroup$
  • $\begingroup$ Thank you for the help... but this does not solve the problem because the slider is still useless, as it cant be used to rotate the bone in a controllable way. $\endgroup$ – MCHammond Apr 15 '14 at 15:19
  • $\begingroup$ If you show a slider of the rotation value it can always display large values. The constraint will make larger values useless, yes it will be up to the animator to keep the values within a reasonable range. But that is the only option to keep the bone rotation within a specified range. The only other option is a bone driven from a custom value that can't be animated in the 3dview. $\endgroup$ – sambler Apr 16 '14 at 10:19
  • $\begingroup$ The slider does not work like that, it will use the min and max values of the property, the bone's rotation_eular.x By defult they are -100,000 and 100,000 so the slider will be from -100,000 and 100,000 from the start making it useless because any slight movement of the slider will jump you 500 degrees. $\endgroup$ – MCHammond Apr 17 '14 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.