Skip to content

Commit

Permalink
Overlap action state
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-Noble committed Jul 27, 2017
1 parent 97e09fe commit e6caced
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cm_bpyNodes.py
Expand Up @@ -754,11 +754,11 @@ class ActionState(StateNode):
stateLength = IntProperty(name="State Length", default=1)
cycleState = BoolProperty(name="Cycle State", default=False)
actionName = StringProperty(name="Action Name", default="")
overlap = IntProperty(name="Overlap", min=0, default=0)
useValueOfSpeed = BoolProperty(name="Use Value of Speed", default=True)
interuptState = BoolProperty(name="Interupt State", default=False)
syncState = BoolProperty(name="Sync State", default=False)
randomActionFromGroup = BoolProperty(
name="Rand Group Action", default=True)
randomActionFromGroup = BoolProperty(name="Rand Group Action", default=True)

def init(self, context):
StateNode.init(self, context)
Expand All @@ -768,6 +768,7 @@ def getSettings(self, item):
item.settings["ValueFilter"] = val.filterProperty
item.settings["ValueDefault"] = val.defaultValueProperty
item.settings["RandomInput"] = val.randomInputValue
item.settings["Overlap"] = self.overlap
item.length = self.stateLength
item.cycleState = self.cycleState
item.actionName = self.actionName
Expand All @@ -793,6 +794,7 @@ def draw_buttons(self, context, layout):
else:
row.prop(self, "randomActionFromGroup", icon="FILE_REFRESH",
icon_only=True)
layout.prop(self, "overlap")
layout.prop(self, "interuptState")
if self.interuptState:
layout.prop(self, "syncState")
Expand Down
3 changes: 2 additions & 1 deletion cm_nodeFunctions.py
Expand Up @@ -690,7 +690,8 @@ def moveTo(self):
action = actionobj.action # bpy action
if action:
currentFrame = bpy.context.scene.frame_current
self.strip = tr.strips.new("", currentFrame, action)
startTime = currentFrame - self.settings["Overlap"]
self.strip = tr.strips.new("", startTime, action)
self.strip.extrapolation = 'NOTHING'
self.strip.use_auto_blend = True
self.strip.mute = self.brain.freeze
Expand Down

0 comments on commit e6caced

Please sign in to comment.