I’ve just started experimenting with motion paths and I’ve got the code below.
“waterfall” and “w3” are NURBS curves (identical curves, but each with unique names i.e. w3.egg is just a copy of waterfall.egg with the names changed) created in Blender.
“female2” and “kayslacks” are two different human models (different models, both with unique mesh/armature names). (I applied a random brick texture just for the sake of testing)
You can also see I’ve assigned everything to different variables, created 2 motion paths and 2 intervals, etc.
I’d expect each model to follow the motion path relative to their respective positions. This is what happens when there’s just 1 model, 1 path and 1 interval. However, when I have both models/paths/intervals, the two models will follow one motion path relative to the 2nd model (e.g. it doesn’t matter what position I set on the 1st model; it gets repositioned to where the 2nd model is and follows the same motion path in the same place).
(I should perhaps also mention that this problem only occurs when the intervals are involved; if I comment out those last 4 lines, both models will be positioned as/where expected by setPos)
Am I missing something about how motion paths/intervals work?
Thanks in advance for any input.
path = Mopath.Mopath() path.loadFile("waterfall.egg") path2 = Mopath.Mopath() path2.loadFile("w3.egg") myTexture = loader.loadTexture("tex/brick1.png") m = loader.loadModel("female2.egg") m.setTexture(myTexture) m.setTransparency(TransparencyAttrib.MAlpha) m2 = loader.loadModel("kayslacks.egg") m2.setTexture(myTexture) m2.setTransparency(TransparencyAttrib.MAlpha) m.setPos(220, 220, 220) # this should move the first model off-screen, but it doesn't; it stays at 0, 0, 0 m2.setPos(0, 0, 0) # changing this moves both models m.reparentTo(render) m2.reparentTo(render) myInterval = MopathInterval(path, m, duration=1, name = "Name") myInterval.loop() myInterval2 = MopathInterval(path2, m2, duration=1, name = "xName2") myInterval2.loop()