new at programming, Python and Blender script, I am trying to give my project a checkbox list witch react to the selected object (here vertex groups but can be anything), so one checkbox or more checkboxes when an object is active and pass a little trial in a function or when needed, another object than the active one act like the active. My problem is :

I know what to do with one checkbox or a define, stable number of checkboxes (example bellow) but not when that number depend on the active object or the object given by a function variable : Maybe because that takes place in the class parameter area and that area seems to not react to:

  • the active object
  • a variable (global nor instance class variable with a list or dict or object passed by a function nor a class method or anything I know only when you start the script, this area seems to never react after, to never "refresh"

So my question is : can I pass this things in a place, class method, function, register area or something that can react to context or other and work like in the class parameter area, or something making the class parameter area react to context or object given by a function variable.

in fact : what

bpy.types.Scene.the_checkbox = bpy.props.BoolProperty(name='the name', description='my description', default = False)

realy mean, How can I access in my script dynamically to "the_checkbox" here above or "the name" ?

maybe the answer is here: https://docs.blender.org/api/current/bpy.types.Scene.html or here: https://docs.blender.org/api/current/bpy.types.ID.html#bpy.types.ID.name I'm trying to understand now... not easy

I find this too: https://docs.blender.org/api/current/bpy.props.html

In fact I saw in the example here: Function Update on Boolean Property in the register area a allready define number of checkboxes. Two of them. But I need a tool with if you select one object with two vertex groups (for example), then two checkboxes, Then an object with none of them = no checkboxes, ten of them = ten checkboxes and since it's in the register area, like in the class parameter, you must define it in advance... something like the properties tab vertex groups, but in the UI region (no problem) and checkboxes instead of locks, reacting to active object or variable designed object

  • 1
    $\begingroup$ Hi and Welcome. Short answer: Yes, you can use a callback by assigning a function to update: blender.stackexchange.com/questions/74744/… However, not always a good idea since blender is context sensitive anyway. Not sure what do you mean "don't react", In order to help I suggest add an example to your question of what you'd actually like to do otherwise this might lead into an endless discussion. $\endgroup$
    – brockmann
    Commented Jun 19, 2020 at 12:49
  • $\begingroup$ Thanks a lot, I saw in the exemple here: blender.stackexchange.com/questions/74744/… $\endgroup$
    – CeyMout
    Commented Jun 19, 2020 at 15:23
  • $\begingroup$ Possibly related blender.stackexchange.com/a/161533/15543 $\endgroup$
    – batFINGER
    Commented Jun 19, 2020 at 16:38
  • $\begingroup$ It seems to be very very very related in fact, I'll try to adapt it soon to my script... thanks a lot ! $\endgroup$
    – CeyMout
    Commented Jun 19, 2020 at 20:18
  • $\begingroup$ Everything seems fine, I just need a trigger that tells in the rereg function when a new object is active... $\endgroup$
    – CeyMout
    Commented Jun 20, 2020 at 16:46


You must log in to answer this question.

Browse other questions tagged .