Skip to content

Hotfix/arnold dso fix #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Softimage/AlembicImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CString getTimeControlExpression(CString timeControlName)
{
return timeControlName + L".current * " + timeControlName + L".factor + " +
timeControlName + L".offset + " + timeControlName +
L".frameOffset / PlayControl.Rate";
L".frameOffset / Fr";
}

ESS_CALLBACK_START(alembic_import_Init, CRef&)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# ExocortexAlembicForceStandinUpdate Plug-in
# Initial code generated by Softimage SDK Wizard
# Executed Tue Jan 17 12:40:35 EST 2017 by ahmidou
#
# Tip: To add a command to this plug-in, right-click in the
# script editor and choose Tools > Add Command.
import win32com.client
from win32com.client import constants
c = constants

null = None
false = 0
true = 1

def XSILoadPlugin( in_reg ):
in_reg.Author = "ahmidou"
in_reg.Name = "ExocortexAlembicForceStandinUpdate Plug-in"
in_reg.Major = 1
in_reg.Minor = 0

in_reg.RegisterEvent("BeginFrame",constants.siOnBeginFrame)

#RegisttimeStepnInsertionPoint - do not remove this line

return true

def XSIUnloadPlugin( in_reg ):
strPluginName = in_reg.Name
Application.LogMessage(str(strPluginName) + str(" has been unloaded."),constants.siVerbose)
return true


# Callback for the BeginFrame event.
def BeginFrame_OnEvent( in_ctxt ):
"""Application.LogMessage("BeginFrame_OnEvent called",constants.siVerbose)

Application.LogMessage("RenderType: " + str(in_ctxt.GetAttribute("RenderType")),constants.siVerbose)

attrArray = in_ctxt.GetAttribute("FileName")
for attr in attrArray:
Application.LogMessage("FileName: " + str(attr),constants.siVerbose)

Application.LogMessage("Frame: " + str(in_ctxt.GetAttribute("Frame")),constants.siVerbose)

Application.LogMessage("Sequence: " + str(in_ctxt.GetAttribute("Sequence")),constants.siVerbose)

Application.LogMessage("RenderField: " + str(in_ctxt.GetAttribute("RenderField")),constants.siVerbose)
"""
# TODO: Put your code here.
remote_control = Application.ActiveProject.Properties( "Play Control" )
properties = Application.FindObjects2( c.siCustomPropertyID)
currpass = Application.GetCurrentPass()
for prop in properties:
if prop.IsKindOf("arnold_standin"):
children = prop.NestedObjects
for child in children:
if child.Type == "alembic_standinop":
Application.Logmessage("Update Alembic Procedural Timestep and MotionBlur Keys")

data = prop.Parameters("dsoData").Value.split("&")
timeStep = 1.0/remote_control.Parameters( "Rate" ).Value
time = timeStep * in_ctxt.GetAttribute("Frame")

data[-2] = "currtime="+str(time)
data[-3] = "time="+str(time)

cPass = Application.GetCurrentPass()
r = cPass.Renderer
rProp = cPass.Properties(r.PropertyName(0, False))
shutter = rProp.Parameters("motion_shutter_onframe").Value
length = rProp.Parameters("motion_shutter_length").Value
sVal = "mbkeys="
if shutter == 0:
sVal += str(time)+";"+str(time+(timeStep*length))
elif shutter == 1:
halfLength=length*0.5
sVal += str(time-(timeStep*halfLength))+";"+str(time+(timeStep*halfLength))
elif shutter == 2:
sVal += str(time -(timeStep*length))+";"+str(time)
else:
min = str(time+(timeStep*rProp.Parameters("motion_shutter_custom_start").Value))
max = str(time+(timeStep*rProp.Parameters("motion_shutter_custom_end").Value))
sVal += min+";"+max
data[-1] = sVal
prop.Parameters("dsoData").Value = "&".join(data)

# This event can be aborted by returning true or false if you don't want to abort.
return false