Replicate object along spline?

Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 09:19

Hey guys!
I'm stuck trying to use a spline for replication of objects by using Loop op. The script does not see the Spline name.
Any ideas how to do that?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby ikam » Tuesday, 20.August 2013, 10:00

it works fine if you set a name for your spline op.

look at this example. anyway cool way to duplicate object, nice idea to use loop.
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 11:20

Wow! Many thanks, man. An unexpected solution - never thought it could be that way \:D/
I will check your example this evening. How did you guess that? Did you look into the code?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby ikam » Tuesday, 20.August 2013, 11:33

no, surely a divin inspiration powered by megatron... :p

I took the beat loop sample (in example.wz4) as main example to see how they call the beat operator in the loop, it is the same thing here.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 11:55

I examined that example also, but as far as I remember the name of the beat op was used in the animation script (not the one used for replication). I was thinking of some sort of conversion between the anim script and the replication script... That is why I failed, probably ;)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby ikam » Tuesday, 20.August 2013, 12:25

The script does not see the Spline name.


maybe it's because I used yellow op instead mesh ops that won't recognize spline name.

note to optimize render you should use a RenderMesh op (just below your final mesh and before EndLoop) with instance set to on to only call 1 time the mesh render and gain fps. In fact as usual with a yellow multiply.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 12:35

I see now, that this solution may not be the one I'm looking for. I was thinking of replicating a ballistic particle emitter along the spline statically, loop its delay time i times (the number of shots), and thus create a possibility to fake blaster bolts shot from a flying star ship without deformation of particle trajectory. What do you think of that?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby ikam » Tuesday, 20.August 2013, 12:46

but why make a thing so complex ?

Why don't you create a spline trajectory for your space ship, and a linear trajectory for your missile, and only trigger the missile animation at the point of the spline when you ship reach it ?
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 13:31

Of course, I can match the trajectories by hand, but the idea was to create a dense and rapid blaster fire - not a single rocket.
If the emitter is animated to move along a spline (startpos=spline(time)), then the particles move with the emitter along the spline which is not phisically correct (as far as I remember, I once sent you an example file showing you all that).

Ballistic emitters replicated along the spline with Loop would be a great solution. One emitter = one Shot unaffected by further emitter's movement along the spline. This way we could use as many "shots" as needed. I think it's a nice and simple idea for simulating that kind of stuff, the only problem being the inability to use a spline in the scripting part of the Ballistic op. I was thinking of this code:
startpos=spilne_name(i/i_value);
delay=i/i_value;
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 18:12

Take a look at what I could do with your file. Not quite there, but very close. Any suggestions?
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby ikam » Tuesday, 20.August 2013, 18:26

cool stuff, I think it can produce very interesting animation effects.

did you tried with a fader to resolve the simultaneous start ?
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 18:34

But how? Fader is just a variable and can't replicate an emitter... :-k
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby ikam » Tuesday, 20.August 2013, 18:48

didn't test, but maybe with multiple ballistic instead of one.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Replicate object along spline?

Postby Skinnytorus » Tuesday, 20.August 2013, 21:06

I've taken a closer look and it seems that this setup is working as it should. The problem now is how to make the ship shoot randomly ](*,)
To tell the truth, I've grown tired of trying to fake a dynamic emitter! I'm sending all my prayers to THE MIGHTY MEGATRON asking him to give you
the strength to implement APEX Particles in wz4! :lol:
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Replicate object along spline?

Postby ikam » Tuesday, 20.August 2013, 22:19

nice samples =D>

lol, I don't have enough time for now to code the physx particles, but yes it is the next feature i'll add to wz4 :)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France


Return to Support



Who is online

Users browsing this forum: No registered users and 7 guests

cron