Browse Source

Add modifier dependencies

These are hints that will auto-enable certain modifiers. It makes no sense
to have an Animation Loop modifier with no Animation modifier...
pull/10/head
Adam Johnson 10 years ago
parent
commit
690bd70360
  1. 7
      korman/operators/op_modifier.py
  2. 1
      korman/properties/modifiers/anim.py

7
korman/operators/op_modifier.py

@ -52,6 +52,13 @@ class ModifierAddOperator(ModifierOperator, bpy.types.Operator):
theMod.display_order = plmods.determine_next_id() theMod.display_order = plmods.determine_next_id()
theMod.created(context.object) theMod.created(context.object)
# Determine if this modifier has any dependencies and make sure they're enabled
deps = getattr(theMod, "pl_depends", set())
for dep in deps:
depMod = getattr(plmods, dep)
if not depMod.enabled:
bpy.ops.object.plasma_modifier_add(types=dep)
return {"FINISHED"} return {"FINISHED"}

1
korman/properties/modifiers/anim.py

@ -140,6 +140,7 @@ class LoopMarker(bpy.types.PropertyGroup):
class PlasmaAnimationLoopModifier(PlasmaModifierProperties): class PlasmaAnimationLoopModifier(PlasmaModifierProperties):
pl_id = "animation_loop" pl_id = "animation_loop"
pl_depends = {"animation"}
bl_category = "Animation" bl_category = "Animation"
bl_label = "Loop Markers" bl_label = "Loop Markers"

Loading…
Cancel
Save