Last active
May 22, 2023 14:10
-
-
Save p2or/f419f4f440191bb52447 to your computer and use it in GitHub Desktop.
Check Modifiers #Blender #BSE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for http://blender.stackexchange.com/questions/42080/check-if-active-object-has-a-modifier | |
# check for specific modifier using any() | |
print ([m for m in bpy.context.object.modifiers if m.type == "SUBSURF"]) | |
# or as function | |
def check_modifier(obj, modifier_type): | |
for modifier in obj.modifiers: | |
if modifier.type == modifier_type: | |
return True | |
else: | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment