You can check it out in the add-on HERE, but I’ve been working on a road generator add-on and have hit the point where I need help on some things. How do I group bpy.props together so I can iterate over them? I’m guessing it’s with bpy.props.collectionproperty…? But that looks like it’d be a class inside a class, and I’m scared of breakin’ all my code.
Short form is I have a registered class with various props:
class OBJECT_OT_add_road(bpy.types.Operator):
laneCount = bpy.props.IntProperty(name = "Lane Count", default = 2, min = 1, description = "Number of lanes")
laneWidth = bpy.props.FloatProperty(name = "lanes", default = 3, min = .01, description = "How wide across each lane is")
dividerWidth = bpy.props.FloatProperty(name = "divider", default = .5, min = 0, description = "division size between east/west traffic lanes")
shoulderWidth = bpy.props.FloatProperty(name = "shoulder", default = 2, min = 0, description = "width of shoulder or parking lane to left/right")
I’d like to, within all these props definitions, group laneWidth, dividerWidth, and shoulderWidth together so I can iterate over them.
I tried x = [self.laneWidth, self.dividerWidth, self.shoulderWIdth] but that didn’t work.
I also tried using names, but that didn’t work. Is there some equivalent of this:
print(self.laneWidth.name) #this doesn’t work
and having it return the props’ name parameter?