View Full Version : ncloth problem, updating initial state
willmoddelforfood 04-18-2007, 07:05 AM hello,
i'm working on a movie, i'm responsible for the clothing of the characters. i've made a shirt for a character thats rowing a boat. i moved the character in the right postion and simulated the cloth for the starting position and set the initial state. the problem i encounterd is: i wasnt too happy about the state the shirt was in and i edited it by using sculpt polygon tool and moving some vertexis around with the move tool and set the initial state again. but when i started to simulate the animation i noticed that the shirt went crazy starting at frame 2. i stopped the simulation and looked at some options, at the nclothshape/surface properties/ solver display i selected bend links (also stretch links) and is saw it was in the same position as before i sculpted the shirt.
http://stud.cmd.hro.nl/0754697/3d/upload/probleem-bend-links.jpg
now my question is: what must i do to update the bend links to my updated shirt initial state?
thanks in advance
|
|
I don't have time to looker deeper into this right now, but I think you should check the manuals for option: edit nCloth -> initial state -> set from mesh.
Als
Duncan
04-18-2007, 05:57 PM
It sounds like you edited the output cloth mesh, not the input mesh. When you create nCloth your original mesh is hidden and becomes upstream construction history. If you want to change the shape of the mesh you should do it on the input mesh (nCloth->display Input Mesh). If you apply changes to the output mesh they are downstream tweaks on the simulated shape, so collisions and such will be wrong.
The set initial state call does not change your input mesh, but rather saves an initial pose on the nCloth node. However if you edited the output mesh with a deformer to create this pose, then when you simulate the deformer will still get applied to the output mesh offsetting the resulting animation. Also currently the setInitialState is based on the internal solver state on the nCloth, not the downstream mesh, thus your set initial state after the deformer did not change anything. If you want to adjust the initial state( as opposed to the input mesh ) then you need to simulate while pushing the surface( perhaps with a constraint temporarily created for this purpose ). If you are mel savy it would be possible to create a script that set the initial state array on the nCloth based on the output mesh cv positions.
Duncan
It sounds like you edited the output cloth mesh, not the input mesh. When you create nCloth your original mesh is hidden and becomes upstream construction history. If you want to change the shape of the mesh you should do it on the input mesh (nCloth->display Input Mesh). If you apply changes to the output mesh they are downstream tweaks on the simulated shape, so collisions and such will be wrong.
Duncan
This is something I wanted to ask.
If you set initial state and then try to change the input mesh, something sort of unpredicted happens. I had that mesh would sort of explode, or just start being unstable from frame 2. Could you try to explain how the transformation done on the input mesh are then reflected on the initial state?
If you are mel savy it would be possible to create a script that set the initial state array on the nCloth based on the output mesh cv positions.
Duncan
Isn't this what: "edit nCloth -> initial state -> set from mesh" does?
Can you explain what does instead?
I also noticed that when saving file, if current time is not at the first frame when saving, initial state doesn't read back when I reread the file, and likes to crash as well.
Startup file is there saved. Sometimes I manage to get it back to start working again if I sort of "rewinded" it few times to go to first frame...
When I think about it, they are particles afer all, so it makes it easier a bit when I think about them in this way, so cloth initial state startup file format is identical as maya particles? Can they be mixed? In other words if I have same number of particles as cloth, and I make simulation, could I then use cashed particle to recreate cloth shape?
I honestly hope I make sense...
Thanks a lot
Als
Duncan
04-19-2007, 12:52 AM
Isn't this what: "edit nCloth -> initial state -> set from mesh" does?
Hah, I forgot we added that one... you are right. If you are trying to edit the initial state with a deformer one should probably duplicate the cloth output mesh first, then apply this deformer to the duplicate and set initlal state from that mesh.
The problem with changing the input mesh after you set initial state is that you may be stretching the mesh relative to the initial state. Thus the initial state is compressed or stretched and it suddenly pops out at the start frame when you simulate. (imagine taking a rubber sheet, stretching it a lot then suddenly releasing... it goes flying all over the place)
In a similar fashion editing the intial state with a deformer on a duplicated mesh could result in the cloth stretching and the initial state could pop. If you want the stretched mesh to also be the rest state you could set this duplicate mesh up as your rest shape, or replace the cloth input mesh with this one.
There were a couple of bugs in 8.5 relating to files that were not saved at the start frame( we since fixed, but I can't comment on when the fixes will be available ). However if you have a reproducable workflow or bug file please enter a bug report. As a general rule it is good to rewind before saving the file.
Particles have a startup cache that saves the state at the current frame when you save the scene, so it can load at that advanced frame with no runup. NCloth actually saves particle startup caches when you save your file, but this is a bug (again something we've fixed since 8.5). In fact if you have a file that crashes on load then it is good idea to look for the particle startup cache and delete it. Currently nCloth does not support a startup cache. The initial state on the nCloth does not use a particle cache, but rather uses an array attribute that on the nCloth node.
Ok, I assumed that initial state is sort of like soft body and in order to set it you need to use particle startup. If this is not so, what then is in particle startup file?
And where we can find array attribute, so how this could be exported/imported except as a mesh?
I had a file which I saved without rewind (client arrived, so I was in a hurry), but I managed to retrive it:
I was rendering last frame in MR, and since I could not wait render to finish I had to kill maya. When I did that, maya saved another particle startup cash which had mental ray in it's name.
When I reloaded it, it didn't crash straight away, but when I rewinded it and started play again it crashed.
Then I reloaded the file again, rewind it, and saved, closed maya.
I copied this mental ray particle startup cash made to this resaved directory startup, reopened maya and file was fine. This led me to believe that it had direct connection...
Als
willmoddelforfood
04-19-2007, 07:49 AM
first of all, thanks for al the replies.
Duncan is correct i edited the output mesh, after i had set an initial state. so i understand now that i did wrong to edit the output mesh. if i remeber correct in maya 7.0 is was possible to edit your cloth object and then update the cloth state and there was no construction history like with ncloths input mesh.
what is was trying to do in my scene is:
http://stud.cmd.hro.nl/0754697/3d/upload/input-mesh.jpg this is my input mesh.
i set some keys to get to the starting position for the animation. then i simulated to get the ncloth also in the starting position for the animation.
the result was this:
http://stud.cmd.hro.nl/0754697/3d/upload/current-mesh.jpg
as you can see this isnt really what you want to look realistic. but i set the initial state. because i remember from maya 7.0 the option update cloth state i went edited this position to the result below.
http://stud.cmd.hro.nl/0754697/3d/upload/edited-current-mesh.jpg
then came along the problem of the first post.
now im asking myself how to edit the input mesh to get a similar result as in the last picture. because when the input mesh is on you dont really see what is happening in the output mesh. or should i use locators and/or constraints and re-simulate to get a propper cloth state?
also possible: my mesh just isnt right and i need to start all over.
http://stud.cmd.hro.nl/0754697/3d/upload/input-mesh-wireframe.jpg
what is the best thing to do?
Well for the topology I would say that there is some triangles there and least density, while I think that this is where you might want to have more then other places.
So depending how many shots you have, if many - you might consider fixing it, otherwise, just try anyway.
It more looks to me that problem might be with cloth step, and maybe the cloth is just not right. Have you try using some of the presets, or this is default cloth?
Also I don't know how you setup joints on the shoulders, etc. so it's not easy to see if there is any problems with that and skining underneath.
Also switch on and see how big is thickness of the cloth, this will give you accurate presentation on your model, because if your thickness is too big, it might get similar result.
But to try to skip all that and just get on with the shot in this case, you need to duplicate your cloth output mesh without history. You can do this with "D" (duplicate with transform). Then select you cloth and this duplicated mesh, and go
"edit nCloth -> initial state -> set from mesh".
Als
CGTalk Moderation
04-19-2007, 01:15 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.