Notifications
Clear all

[Closed] Removing controllers from animated vertices?

I have a very highres model that is very slow to select. After looking into the problem I found that almost all of the vertices have controllers assigned to them. The vertices must have been animated at some point. Is there any way to remove these controllers? Thanks.

-bnvm

12 Replies

I don’t know if it is possible, but you can make a snapshot of the mesh quite easily, which should re-create it without anything animated.

Use the snapshot tool or select your object run this script


 m=mesh mesh:(snapshotasmesh $)
 

you will loose your modifier stack though…

J.

Thanks for the reply. I have already tried taking a snapshot but it doesn’t get remove the controllers from the vertices, in fact it doesn’t even remove the vertex animation of some already exists. I may have found a solution. with a script I create an empty mesh and attach the old mesh to it. That removes any animation and controllers, but I loose the mapping coordinates for some reason. Any ideas on how I can prevent that from happening or on how to reapply the old mapping coordinates after the attachment?

ah but you haven’t tried my magic script have you!

J.

Yes your magic script did work, however I lost all material and texture information for the object.

I have solved this problem storing the texture coordinates for the original object, attaching the original object to an empty mesh object, and reassigned the stored texture coordinates and everything works great. But now I have another problem.

I have a model that has been broken up into several pieces with vertex animation on them. I want to be able to combine them into a single mesh keeping the vertex animation intact. I have been able to do this by creating a empty mesh for moving objects to, storing the vertex positions, attaching the mesh and then reanimating the added vertices on the new mesh. Everything works well, but sometimes I loose the texture coordinates on some of the objects when it is attached to the empty mesh. I have tried my script on several models on some the texture coordinates are fine and others they are not. I believe that when an the first object with texture coordinates is attached that texture info is lost, but any objects attached after that one will retain the texture coordinates when attached. Is there any way to attach an object without loosing these texture coordinates?

-bnvm

well I’m intrigued, because when i test it the texture co-ords are rettained. make sure you’re collapsing everything first, maybe post an example or workflow that can replicate the problem and I’ll have a look.

J.

My script creates a empty mesh and attaches all the objects in a selected group one by one. This script works most of the time but on a few of my models I have had trouble with loosing texture coordinates. This script always looses the texture coordinates.

In this case I have a vehicle model that in a single mesh, and the modifier stack is completely collapsed.

newMesh = mesh numVerts:0 numFaces:0
newMesh.pivot = $.pivot

meshop.attach newMesh $ attachMat:#IDtoMat

This is a simplified version of my script. Everytime I run this script the mapping coordinates are lost.

I updated my script to work with an editable poly instead and everthing is working great now. I would be nice to know why it doesn’t work with an editable mesh though. Here is the updated script. Now texture coordinated are retained.

newMesh = mesh numVerts:0 numFaces:0
newMesh.pivot = $.pivot

convertTo newMesh (Editable_Poly)
polyop.attach newMesh $

I think it is becuase you’re creating a new mesh without texture co-ordinates. There is a note in the help saying that the TVerts feature of mesh() is broken and Tfaces are not built. I don’t know if this is related but it wouldn’t surprise me. You can get around it by re-structuring your code:


m=mesh mesh:($.mesh)
meshop.attach m $ attachMat:#IDtoMat

Seems like you would be better of with one of those funky new-age poly’s anyway!

Josh.

Your explanation about the mesh command sounds correct. Using edit poly’s turned out to be a good solution since it also fixed a problem I was having on objects with multi sub object materials assigned to them. With the edit mesh option the material assignment would get messed up as the objects where attached. That hasn’t happened since I started using edit polys. However when attaching objects to an edit poly the controllers on the mesh are retained so the object is still very slow to select. The solution I came up with is pretty simple.

To remove all controllers from an objects vertices –

1.) Create an empty edit poly object and attach the objects to it.
2.) Convert the new object to an editable mesh, and store the texture coordinates.
3.) create a new empty mesh object and attach the converted model to it.
4.) transfer the texture coordinates back to the object.
I am not sure if all of these steps are required, but this process has worked flawlessly for me so far. If combining multiple objects into a single object is not required then step 1 can be skipped.

Sounds like you have a solution.

Just one more point, make sure you’re not using $ in your script, it is too unreliable since the selection might change during execution. I know you’re probably not but just thought I’d mention it1

Good luck

J_man.

Page 1 / 2