Merge pull request #2151 from N8n5h/coll-mask

Expose collision filter mask as integer to the UI
This commit is contained in:
Lubos Lenco 2021-04-04 10:49:13 +02:00 committed by GitHub
commit 69207a6289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,13 @@ class ARM_PT_RbCollisionFilterMaskPanel(bpy.types.Panel):
layout.use_property_decorate = False
obj = context.object
layout.prop(obj, 'arm_rb_collision_filter_mask', text="", expand=True)
col_mask = ''
for b in obj.arm_rb_collision_filter_mask:
col_mask = ('1' if b else '0') + col_mask
col = layout.column()
row = col.row()
row.alignment = 'RIGHT'
row.label(text=f'Integer Mask Value: {str(int(col_mask, 2))}')
def register():
bpy.utils.register_class(ARM_PT_RbCollisionFilterMaskPanel)