0
$\begingroup$

I'm trying to make a panel for a addon i'm working on and one of the things i need is a checkbox for each vertex group of the active object. i have registered a boolean property for the VertexGroup type and am trying to use it as the bool value of the checkbox. no checkboxes have shown up and i am getting this error.

rna_uiItemR: property not found: VertexGroup.VisableBool

if i change to code so the new property is added to the Object type it works fine and shows the checkboxes but i need the bool props in VertexGroups not in Objects.

What am i doing wrong? i've been fighting with this for hours and can't seem to figure it out.

code snippet:

for i in context.active_object.vertex_groups:
        col1.label(text=str(i.name))
        col3.operator("mesh.dummy_op", icon="RESTRICT_VIEW_OFF", text="")
        col2.prop(i, "VisableBool")
        print(i)
        print(i.name)
        print(type(i))
def register():
        bpy.utils.register_class(DummyOp)
        bpy.utils.register_class(MainPanel)
        bpy.types.VertexGroup.VisableBool = bpy.props.BoolProperty(name = "Test", default = True)
$\endgroup$
3
  • $\begingroup$ do you want to add the custom property to some new panel and conected to vertexgroups... or you want create the custom properties in the "data" panel.... ?check image please imgur.com/uMubMY3 $\endgroup$
    – yhoyo
    Mar 23 '17 at 5:02
  • $\begingroup$ @yhoyo it should be a property of VertexGroup but it is intended for use in a custom panel. $\endgroup$
    – Tainin
    Mar 23 '17 at 12:09
  • $\begingroup$ @yhoyo #1 as in your image* $\endgroup$
    – Tainin
    Mar 23 '17 at 13:23
0
$\begingroup$

Unfortunatly I have solved (not really) the problem myself. It turns out that the VertexGroup type is "Read Only" meaning you cannot add properties to it. The reason that it worked with the Object type is that it is not "Read Only". I guess i am going to have to come up with a new solution to the problem.

$\endgroup$

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.