> Sounds like it might work.
> Did you run the scripts? You will see what the curve does... If your 
> suggestion does exactly the same thing then you're correct. :)

ran it now – looks the same to me.
since there’s no plotting involved it could be interesting in keeping the 
relation live... 
(but you would need to keep the copy of the curve and second null’s animation 
identical then )

here it is:
Application.CreatePrim("Spiral", "NurbsCurve", "", "")
Application.SetValue("spiral.spiral.height", 10, "")
Application.GetPrim("Null", "", "", "")
Application.ApplyPath("null", "spiral", 1, 100, "", True, True)
Application.DeselectAll()
Application.SelectObj("spiral", "", True)
Application.Duplicate("spiral", "", 2, 1, 1, 0, 0, 1, 0, 1, "", "", "", "", "", 
"", "", "", "", "", 0)
Application.GetPrim("Null", "", "", "")
Application.ApplyPath("null1", "spiral1", 1, 100, "", True, True)
Application.SelectObj("spiral", "", "")
Application.Translate("", 10, 0, 0, "siAbsolute", "siPivot", "siObj", "siX", 
"", "", "", "", "", "", "", "", "", 0, "")
Application.Translate("", 0, 0, 10, "siAbsolute", "siPivot", "siObj", "siZ", 
"", "", "", "", "", "", "", "", "", 0, "")
Application.Translate("", 0, 10, 0, "siAbsolute", "siPivot", "siObj", "siY", 
"", "", "", "", "", "", "", "", "", 0, "")
Application.ActivateObjectSelTool("")
Application.SelectObj("spiral1", "", True)
Application.ActivateObjectSelTool("")
Application.ApplyOp("ICETree", "spiral1", "siNode", "", "", 0)
Application.AddICENode("$XSI_DSPRESETS\\ICENodes\\GetDataNode.Preset", 
"spiral1.crvlist.ICETree")
Application.SetValue("spiral1.crvlist.ICETree.SceneReferenceNode.reference", 
"null.kine.global.pos", "")
Application.AddICENode("$XSI_DSPRESETS\\ICENodes\\GetDataNode.Preset", 
"spiral1.crvlist.ICETree")
Application.SetValue("spiral1.crvlist.ICETree.SceneReferenceNode[1].reference", 
"spiral.kine.global.pos", "")
Application.AddICENode("$XSI_DSPRESETS\\ICENodes\\SubtractNode.Preset", 
"spiral1.crvlist.ICETree")
Application.ConnectICENodes("spiral1.crvlist.ICETree.SubtractNode.first", 
"spiral1.crvlist.ICETree.SceneReferenceNode.value")
Application.ConnectICENodes("spiral1.crvlist.ICETree.SubtractNode.second", 
"spiral1.crvlist.ICETree.SceneReferenceNode[1].value")
Application.AddICENode("$XSI_DSPRESETS\\ICENodes\\MultiplyByScalarNode.Preset", 
"spiral1.crvlist.ICETree")
Application.ConnectICENodes("spiral1.crvlist.ICETree.MultiplyByScalarNode.value",
 "spiral1.crvlist.ICETree.SubtractNode.result")
Application.SetValue("spiral1.crvlist.ICETree.MultiplyByScalarNode.factor", -1, 
"")
Application.AddICENode("$XSI_DSPRESETS\\ICENodes\\SRTToMatrixNode.Preset", 
"spiral1.crvlist.ICETree")
Application.ConnectICENodes("spiral1.crvlist.ICETree.SRTToMatrixNode.translation",
 "spiral1.crvlist.ICETree.MultiplyByScalarNode.result")
Application.AddICECompoundNode("Set Data", "spiral1.crvlist.ICETree")
Application.ConnectICENodes("spiral1.crvlist.ICETree.Set_Data.Value", 
"spiral1.crvlist.ICETree.SRTToMatrixNode.matrix")
Application.ConnectICENodes("spiral1.crvlist.ICETree.port1", 
"spiral1.crvlist.ICETree.Set_Data.Execute")
Application.SetValue("spiral1.crvlist.ICETree.Set_Data.Reference", 
"spiral1.kine.global", "")
Application.SetValue("PlayControl.Key", 7, "")
Application.SetValue("PlayControl.Current", 7, "")
*written with my thumbs

On Jan 15, 2016 3:05 AM, <[email protected]> wrote:

  if I read this correctly – you’re just doing position – not orientation right?

  it works in ICE like this:

  for a null path constrained on curve.
  make an identical copy (null1 on curve1)

  [( null global pos – curve global pos ) multiply by –1 ]   >> translation 
port of an SRT to Matrix >> set curve1 global transform 

  null1 stays put at the origin...

  I’m probably oversimplifying things?
  From: Steven Caron 
  Sent: Thursday, January 14, 2016 8:56 PM
  To: [email protected] 
  Subject: Re: Object motion converted to path animation but normalized 
atorigin?

  For those interested in following... 

  here is two scripts, one to set up the scene so you can see the scenario to 
start, and then another to normalize the motion per David's simpler method. 

  #python
  #setup example scene
  Application.SICreateCurve("crvlist", 3, 0)
  Application.SIAddPointOnCurveAtEnd("crvlist", 486.895161434139, 
325.493002786473, 34.5570511051906, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", 409.033597647559, 
271.688103800014, 29.5535480810531, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", 85.4440658602002, 
300.987801267806, -66.6103573229066, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", -246.20762156975, 
272.753547344553, -147.807009721528, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", -497.571600133753, 
131.0495559517, -173.495355859157, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", -456.369852362362, 
-4.26177417487577, -122.038908353107, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", -81.571345301959, 
14.3834878497712, -26.3265899671214, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", 233.227806621437, 
145.965765570476, 19.5179940313196, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", 553.247813449155, 
111.871572155872, 116.146231591289, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", 537.167802185775, 
-116.666068097906, 179.907658216995, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", 228.873883716215, 
-268.49177316504, 141.853471471277, False, 0, "")
  Application.SIAddPointOnCurveAtEnd("crvlist", 124.433876714773, 
-305.782297213815, 124.747175301071, False, 0, "")
  Application.CreatePrim("Cone", "MeshSurface", "", "")
  Application.SetValue("cone.cone.radius", 3, "")
  Application.SetValue("cone.cone.height", 12, "")
  Application.ApplyCns("Path", "cone", "crvlist", "")
  Application.SaveKey("cone.kine.pathcns.perc", 1, "", "", "", "", "")
  Application.SetValue("PlayControl.Current", 100, "")
  Application.SetValue("PlayControl.Key", 100, "")
  Application.SetValue("cone.kine.pathcns.perc", 100, "")
  Application.SaveKey("cone.kine.pathcns.perc", 100, "", "", "", "", "")
  Application.SetValue("cone.kine.pathcns.tangent", True, "")
  Application.SetValue("cone.kine.pathcns.dirx", 0, "")
  Application.SetValue("cone.kine.pathcns.diry", 0, "")
  Application.SetValue("cone.kine.pathcns.dirz", 1, "")
  Application.SetValue("cone.kine.pathcns.dirx", 0, "")
  Application.SetValue("cone.kine.pathcns.diry", 1, "")
  Application.SetValue("cone.kine.pathcns.dirz", 0, "")
  Application.SetValue("cone.kine.pathcns.upvct_active", True, "")


  #python
  #normalize and invert motion of path cns
  Application.GetPrim("Null", "", "", "")
  Application.SetValue("null.Name", "parent", "")
  Application.Duplicate("parent", "", 2, 1, 1, 0, 0, 1, 0, 1, "", "", "", "", 
"", "", "", "", "", "", 0)
  Application.SetValue("parent1.Name", "child", "")
  Application.CopyPaste("child", "", "parent", 1)
  Application.SelectObj("parent", "", "")
  Application.ApplyCns("Position", "parent", "cone", "")
  Application.SelectObj("child", "", "")
  Application.ApplyCns("Position", "child", "crvlist", "")
  Application.PlotConstrainedTransformsToActions("child", "plot", 1, 100, 1, 
20, 3, False, 0.01, True, True, True, True, True)
  Application.SelectObj("parent,child", "", "")
  Application.RemoveAllCns("", "")
  Application.SelectObj("crvlist", "", True)
  Application.ApplyCns("Position", "crvlist", "child", "")
  Application.SelectObj("parent", "", "")
  Application.ResetTransform("", "siObj", "siTrn", "siXYZ")


  On Thu, Jan 14, 2016 at 11:48 AM, Steven Caron <[email protected]> wrote:

    Not really, I have it working how I want now, I had come up with my own way 
but also David Barosin on the SItoA list (I accidentally posted there) gave me 
a simpler answer. Here is David's response... 



      If the plane is on a curve, a hierarchy of 2 nulls could do it.  
      The parent null is constrained to the plane. The child null is 
constrained to the curve.  Plot the child null's position. 
      Remove the constraints from both nulls. 
      Now constrain the curve to the child null and zero out the parent null's 
SRT.   
      Hope that makes sense. 

Reply via email to