fix: test object type before executing
This commit is contained in:
parent
9340c074b8
commit
cdcecd5cab
@ -90,6 +90,11 @@ class ExportConstraint(bpy.types.Operator):
|
|||||||
filepath: bpy.props.StringProperty()
|
filepath: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
# Assert the selected file is a bone
|
||||||
|
if context.active_object.type != 'ARMATURE':
|
||||||
|
self.report({'ERROR'}, "Active object is not an armature.")
|
||||||
|
return {'CANCELLED'}
|
||||||
|
|
||||||
# Do something with the selected file path
|
# Do something with the selected file path
|
||||||
print("Selected file:", self.filepath)
|
print("Selected file:", self.filepath)
|
||||||
# Call the function or perform the desired actions using the file path
|
# Call the function or perform the desired actions using the file path
|
||||||
|
Loading…
Reference in New Issue
Block a user