4
$\begingroup$

How can I make a custom UI widget, using Blender Python, which cannot be animated by the user?

enter image description here --> enter image description here

enter image description here

I've looked on the docs but can't find reference to 'preventing' animation.

$\endgroup$
2
  • $\begingroup$ Why would you want to do that? What problem are you trying to solve? $\endgroup$
    – Ron Jensen
    Jan 23, 2022 at 6:49
  • $\begingroup$ I have a script that adds a speaker every X-amount of frames. It's the property for that X-amount that I want to prevent from being animated. Animating it doesn't change how the speakers are made, it just uses the value when the script was started, so being able to animate that value just confuses things. $\endgroup$
    – Candle
    Jan 23, 2022 at 7:10

1 Answer 1

6
$\begingroup$

By default, props has ANIMATABLE option. Just override it by passing empty set:

Frame: bpy.props.IntProperty(
   name = "frame",
   default = 0,
   options = set()
   )
$\endgroup$
5
  • $\begingroup$ Thank you, modifying this a little has appeared to have fixed it. Instead of [] I used options = {'HIDDEN'} and it appears to be working. $\endgroup$
    – Candle
    Jan 23, 2022 at 11:29
  • $\begingroup$ I just found that I've used : instead of '='. That was a mistake. But yes, I can mess up with the names: list, array, set, dictionary, etc... $\endgroup$
    – Crantisz
    Jan 23, 2022 at 11:29
  • 1
    $\begingroup$ @Smail at least I've shown the direction, I'm not a pro in Python, as you see $\endgroup$
    – Crantisz
    Jan 23, 2022 at 11:31
  • $\begingroup$ A direction's sometimes better than an answer since it leads you to think for yourself. I'll mark the answer correct; could change it to {'HIDDEN'}? $\endgroup$
    – Candle
    Jan 23, 2022 at 11:33
  • 2
    $\begingroup$ I've checked, seems to be that Gorgious's comment is correct. Changing to set() $\endgroup$
    – Crantisz
    Jan 23, 2022 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .