Hy everyone,
Would you know how to display the length of a collection in an interface?
pose_bones = bpy.context.active_object.pose.bones.items()
p_idx = len(pose_bones)
It may sound silly, but I don’t see how to display a number like p_idx with a prop that isn’t attached to an element or that uses len().
Have a good night,
It’s amazing that armature is not a function that directly returns the number of bones.
I found this way
bpy.types.WindowManager.my_prop_1 = bpy.props.IntProperty(name="name Test Prop", default=0)
pose_bones = bpy.context.active_object.pose.bones.items()
p_idx = len(pose_bones) # bones
print("NUMBERS : "+ str(p_idx))
c.prop(bpy.context.window_manager, "my_prop_1")
bpy.context.window_manager.my_prop_1=len(pose_bones)
You think that’s the most effective?
Good Day,