PDA

View Full Version : HOW DO YOU DO THIS IN LW?:Cloth Dynamics and Morphs


TrexGreg
05-26-2005, 08:42 PM
Hello...

I have a cloth dynamic simulation of a fabric falling and relaxing onto
an object. The moment the fabric is relaxing on the object, i want to morph
it into another fabric object, which is the same as the original, but
modeled in specific relaxed position. I tried all the MDD plugins and
options, but had no luck, so far.

Any tips would be very appreciated...

Thanks,
______________________
Gregg "T.Rex" Glezakos
3D Artist

l1ghtwave3dee
05-26-2005, 08:55 PM
If your running 8.0 you could edit the motion path of some points in the fabric to achieve a specific end position. This method is tedious but can work.

TrexGreg
05-26-2005, 09:00 PM
If your running 8.0 you could edit the motion path of some points in the fabric to achieve a specific end position. This method is tedious but can work.

That would be overkill, as all the points should be edited and the cloth object have... a lot!
Is there a way to make morphs take over the cloth sim?

Celshader
05-26-2005, 09:08 PM
I tried all the MDD plugins and options, but had no luck, so far.

Did you try MD_Plug with "Key-Move" set to "ON"?

TrexGreg
05-26-2005, 09:12 PM
Did you try MD_Plug with "Key-Move" set to "ON"?

Yes...
For some reason, it explodes and wacks the polygons of the cloth object...
Thanks...

monovich
05-26-2005, 09:14 PM
can you save the final resting postion of a MD object as a new object (save transformed) and then create the morph in modeler? Then perhaps do a one frame dissolve between the MD object and the morph object, then appy the morph to the morph object.

I'm not sure this would work. just an idea.

TrexGreg
05-26-2005, 09:25 PM
can you save the final resting postion of a MD object as a new object (save transformed) and then create the morph in modeler? Then perhaps do a one frame dissolve between the MD object and the morph object, then appy the morph to the morph object.

I'm not sure this would work. just an idea.

Well... I did that...

While it works, it's not the desired effect, as you loose immediately over a key the cloth sim and you go to the morph animation. While the two objects are identical, through the way you discribe, the fluidity of the motion is lost. It dosen't look good at all.

What i want is an "animated transition" during the cloth sim, from the dynamic controlled cloth object to the still modeled cloth object...

Thanks....

monovich
05-26-2005, 10:05 PM
hmm... it's beyond me.

maybe there is some way to work backwards from your final desired resting position. I somehow doubt it.

-s

TrexGreg
05-26-2005, 10:14 PM
hmm... it's beyond me.

maybe there is some way to work backwards from your final desired resting position. I somehow doubt it.

-s

Thanks, Stephan...
I'm gonna beat this one, as i don't have a choice; it's a commercial job. As soon as i find a solution-cheat-whatever, i'll post it here with the results...
Cheers,
___________________
Gregg "T.Rex" Glezakos
3D Artist

cyphyr
05-26-2005, 11:21 PM
Just an idea ...

could you use the final modeled object to deform the cloth object before it becomes deformed by the cloth dynamics, make the newly deformed object a morph target of the cloth object, and then morph from one to the other over the simulation from the point where it touches your colision object.

Like I say, just an idea,, I've no idea weather it would work, I've never figured out cloth dynamics.

cyphyr

Celshader
05-26-2005, 11:32 PM
Hello...

I have a cloth dynamic simulation of a fabric falling and relaxing onto
an object. The moment the fabric is relaxing on the object, i want to morph
it into another fabric object, which is the same as the original, but
modeled in specific relaxed position. I tried all the MDD plugins and
options, but had no luck, so far.

I just re-read the above and thought of an "old-school" solution...

Couldn't you start with the specific relaxed object, calculate it floating upwards off of the collision object, and then use "reverse-photography" on the resulting image sequence? You could use "Start by Event" to make the corners detach and float upwards before the center of the sheet would detach and float upwards.

If reversing the image sequence alone is not enough for your needs...there's an extreme method to play MDD files backwards. I've done it, and it's not pretty, but it works. Bake out an object sequence using the free SAVE TRANSFORMED LScript (http://www.flay.com/GetDetail.cfm?ID=1075), set up Multiple Target/Single Envelope on the sequence and use the MTSE envelope to control the playback.

The reason the morph target's not working is because (and I should have remembered this) the morph deformation's getting layered ON TOP OF the MDD deformation. If the morph target says: "Move 1m to the right," then that information will get layered on top of the MDD calculation even if all the points are already moved 1m to the right.

---

There is a playback mode in ClothFX called "local" that can get faded out over time. It might still be possible to layer a morph target on top of the last MDD frame without breaking and distorting the mesh. Set the Playback Mode to "local." Fade the MotionSize out to 0% when you raise the morph target to 100%. If you blend the two deformations in this way, they might not fight each other so much.

I don't have time to test this, though, so I'm not certain if MotionSize is the correct answer. If local playback does not work, please consider my "reverse photography" suggestion.

TrexGreg
05-27-2005, 12:49 AM
Couldn't you start with the specific relaxed object, calculate it floating upwards off of the collision object, and then use "reverse-photography" on the resulting image sequence? You could use "Start by Event" to make the corners detach and float upwards before the center of the sheet would detach and float upwards.

If reversing the image sequence alone is not enough for your needs...there's an extreme method to play MDD files backwards. I've done it, and it's not pretty, but it works. Bake out an object sequence using the free SAVE TRANSFORMED LScript (http://www.flay.com/GetDetail.cfm?ID=1075), set up Multiple Target/Single Envelope on the sequence and use the MTSE envelope to control the playback.

The reason the morph target's not working is because (and I should have remembered this) the morph deformation's getting layered ON TOP OF the MDD deformation. If the morph target says: "Move 1m to the right," then that information will get layered on top of the MDD calculation even if all the points are already moved 1m to the right.

There is a playback mode in ClothFX called "local" that can get faded out over time. It might still be possible to layer a morph target on top of the last MDD frame without breaking and distorting the mesh. Set the Playback Mode to "local." Fade the MotionSize out to 0% when you raise the morph target to 100%. If you blend the two deformations in this way, they might not fight each other so much.

Hmm...
The "reverse" trick sounds interesting. I'll check it out, asap.

In the "Local" playback mode, if i envelope out the Motion Size, the mdd motion fades out, as you said, but the object dosen't see any morph then (tried both Morph Mixer and plain old Morph).It just revert to it's original "base" position.

I feel like i'm "fighting" here with Lightwave's limitations. It SHOULD be a simple thing, lay a morph on top of a baked dynamic simulation, no?
Thanks for the tips...

Celshader
05-27-2005, 01:05 AM
Hmm...
The "reverse" trick sounds interesting. I'll check it out, asap.

You're right -- some things can be made simpler. I just tried something a LOT simpler than the Save Transformed Sequence trick.

With Playback Mode set to "Local," set the Speed value to -100%. The MDD file will now be played backwards from the starting frame. If the MDD file is 60 frames long, set the Shift Frames setting to 60 so that the MDD file plays backwards from 0 to 60.

I apologize for not trying this sooner. The reason I came up with the Save Transformed sequence trick a few months ago was because a friend needed to scrub through the MDD file during the animation, and ClothFX does not yet have controls for this.

Playing the MDD file backwards, though, is no problem for ClothFX.

I apologize for not coming up with the simpler method sooner. :blush:

Celshader
05-27-2005, 01:20 AM
I feel like i'm "fighting" here with Lightwave's limitations. It SHOULD be a simple thing, lay a morph on top of a baked dynamic simulation, no?
Thanks for the tips...

Y'know, I feel even more foolish now. The two "simple" ways (if not "easy" ways) to blend the end of the MDD animation together with the final morph target might be this:

(as suggested above by someone else, I think)

Use Save Transformed to bake out the last frame of the MDD animation as an object.

Morph between the baked object and the final morph target object.

---

If you have textures that won't survive the Save Transformed process and are willing to get your hands dirty, consider this:

Use Save Transformed Sequence to bake out the entire MDD animation.

Load all of the objects into Layout -- and hide them.

Use Multiple Target Single Envelope to morph from object001.lwo through objectxxx.lwo with a single envelope, to duplicate the effect of MDD playback.

Make the last object in the MTSE chain your "final morph target" object.

It's inelegant, but it'll do the job if you're happy with both your MDD calculation and your final morph target.

TrexGreg
05-27-2005, 02:06 AM
Use Save Transformed to bake out the last frame of the MDD animation as an object. Morph between the baked object and the final morph target object. Use Save Transformed Sequence to bake out the entire MDD animation.Use Multiple Target Single Envelope to morph from object001.lwo through objectxxx.lwo with a single envelope, to duplicate the effect of MDD playback.Make the last object in the MTSE chain your "final morph target" object.

Well...
The Save Trasnform "trick" either for a single object or object sequence i thought at first. But, as i said earlier, it dosen't "cut in" for this particular task, because i want to morph NOT from the single last frame of the dynamic cloth deformed object to the modeled one, but during the last FORTY frames. In theory, i want to morph the cloth object at a specific time -the last 40 frames of the dynamic cloth sim- to the modeled relaxed position and on top of that, i want to do the dynamic cloth sim, which i should be able to smoothly fade out during the time i fade in the morph. Just like blending two motions in Motion Mixer or a disolving effect between two clips in non-linear video editing.
Hope this make more sence...

I'll try tomorow the "inverse trick"; it's waaaay past bed time here...

Thank you all for your help so far....

Regards,
Gregg "T.Rex"

telamon
05-27-2005, 09:50 AM
I think the save transform can do the trick.

Assume the folding stops at frame 30. Make several save endomorphs in layout for frame 29, 28, 27, 25, 23, 20, 17,...

in layout use 2 copies of the object, the first one is the cloth simulation, the second one will have endomorphs, use the 1 frame dissolve to hide the old one at frame 30 and display the new one at frame 31 with the frame_endo 29

apply the endomorphs with the morph mixer

frame 31 >> endoframe 29
frame 32 >> endoframe 28
frame 33 >> endoframe 27
frame 35 >> endoframe 25

and so on and apply your morphed position at the end of the animation.

The more the sampling rate is low, the more you get control on the smoothness of the animation.

TrexGreg
05-27-2005, 01:05 PM
Hey, guys!
I've got a solution!:thumbsup:

It was right there in front of me and didn't thought about it earlier, even when i mention a hint about it in previous posts. I've to leave now, but ASAP i'll post a walkthrough here...
Thank you all for your help....:applause:

___________________
Gregg "T.Rex" Glezakos
3D Artist

HowardM
05-27-2005, 03:21 PM
anxiously awaits!
:bounce:

bardakos
05-27-2005, 03:58 PM
the guy knows how to add interest to a thread :)

...

monovich
05-27-2005, 04:05 PM
this thread is like steak: good eatin'

I'm waiting to see the solution!

TrexGreg
05-28-2005, 12:39 PM
Hey, guys...
Here's what i did to overcome the problem that cloth dynamics and morphs don't work together at first place.

My first attempt was to bake all the cloth dynamic simulation to an mdd file and then use the MD_MetaPlug and MD_MetaPlug_Morph plugins to blend the baked sim with a morph. This didn't work as expected, as the morphs were additive to the baked sim.

The next attempt was using the baked sim inside the ClothFX panel and fiddling with the "Playback Mode" and "Motion Size" at the File tab, as Celshader advised. That didn't work also for the same reason; the morphs were additive to the baked sim and the object was exploding.

After that, i abandon the mdd format and try the "Save Transform" technique, as many of you suggested. The simulation was 150 frames. I saved both 150 transformed objects and 150 endomorphs. Using plain morph, Morph Mixer or the MTSE morph technique wasn't enough, as the morphs were either linear from the last cloth frame of the sim to the relaxing object, or the morphs were also additive and ruin the object.

Then i realized that what i actually wanted is to take one animated by morphs object, to blend it to another morph animated or not object, like a simple dissolve between two clips in a non-linear editing program. And guess what! The only way we can do that and not have additive behavior between the morphs is with Motion Mixer!

Motion Mixer can read Xtra Channels, which among others are the Morph channels an object may have; for the record, mdd files don't work with Motion Mixer. For this to work we have to bake the entire mdd sequence to endomorphs on a frame by frame basis and then manually envelope in the Morph Mixer panel the motion of the simulation, this time through morphs. We can bake the mdd file to endomorphs using the "Save Morph Series (http://www.flay.com/plugs/downloads/f_savemorphseries.zip)" free plugin. This process is not fun at all and the longer the dynamic sim you have, the longer it takes to envelope the endomorphs frame by frame, though it's simple.

What we do is to add key frames for every endomorph on a frame by frame basis. For example, on frame 44 we envelope the endomorph 44 to 100% and make sure that this endomorph is 0% at frames 43 and 45. For frame 45 we key frame the endomorph 45 to 100%, making sure it's 0% at frames 44 and 46. All the endomorphs should have three key frames, except the first one which starts at 100% and drops at the next frame to 0%.

When we finish, we can check if all the morphs are in order by scrubbing the timeline or creating a preview. If hiccups occur then we may have added key frames where they shouldn't be or we may have lost somewhere the order of the morph series. Since we want our cloth sim to morph to a better relaxed position, we also have to model that position as an endomorph and key frame that a frame after the cloth morph sim stops; for our case it's the frame 151.

Now its the fun part. Open Motion Mixer and create an Actor of the object with the morph baked sim. Then create two motions. One using the frame range the sim takes place, for this case, 0 to 150 and a second motion from frame 151 to any where you like; it's a still frame motion for our case.

That's it! Add the two motions to two tracks and create a transition between them. You can time the transition period by dragging the left end of the second motion.

I haven't try it yet, but i think that a similar result can be achieved by using the "Smart_Morph (http://www.polas.net/smorph/index.php)" plugin from Pawel Olas, which might be somewhat easier to set up than the frame by frame endomorph setup. But that's a commercial product and the Motion Mixer solution is a free out-of-the-box solution.

That's all...:thumbsup:
Thank you all for your suggestions, thoughts and comments....:applause:
___________________
Gregg "T.Rex" Glezakos
3D Artist

Celshader
05-28-2005, 05:29 PM
Thank you for sharing this technique!

pelmen
10-15-2005, 09:08 AM
Another simple method which may help others doing a similar effect would be to use a target object (in your case the final shape of the settled cloth) as a collision object for your cloth. Just make it an invisible object so it doesn't effect the render but it will sit there and help guide the cloth to settle in the shape you want. Use a simple flat-to-target morph on the invisible object to help the cloth along a bit. Fairly quick and simple solution for when you need the cloth to settle "roughly" where you want it.

HowardM
10-16-2005, 04:42 PM
Cheers mate! :)

CGTalk Moderation
10-16-2005, 04:42 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.