Morph from 3ds max to unity

hi guys :slight_smile:

I’m trying to implement morph into unity.
I have made a very simple morph in 3ds max with 2 sphere’s.

My question: how do I get it to work in Unity, I imported my 3ds max file in Unity and play automatically is on but nothing happens.

I’m not a very great scripter so if anyone has a solution please let me know.

Thanks!

Unity doesnt support morphing, you will need to write your own script and or shader to do it. Starting point for you would be the wiki http://www.unifycommunity.com/wiki/index.php?title=MeshMorpher

I’m aware of the fact that unity doesn’t support this, but I have seen some people managed to do so with scripting.

So I was wandering or anyone has a basic script which will allow me to morph a sphere to the same one but then with curves for example.

I have seen a example with faces in unity, so it is possible, but I am not able to make such scripts.

So I hope someone has a simple one which I may use :slight_smile:

Regards

A link to the wiki was provided… it’s got a script you could use already.

Will this script work on a character skinned with Character Studio, that has shapes in the “Morpher”?

Thanx!

sb

No, you are asking about something that is as elusive as the lockness monster, debated as much as as Area 51 and a club to bash the gopher heads of anyone who asks for years.

I’ve heard that people have done it… I’ve seen blurry shaky video… is it a hubcap or a skinned morph??? Experts have argued for years!

This seems as one of those tightly held secrets for the “people in the know”, I’m convinced that it would be easier to find the Arc Of The Covenant than to find this, as one person put it, “only 20 lines of code

My travels led me to an ancient Abby in Utrecht Holland where deep in the Catacombs I unearthed a stone carvings in an ancient Dutch dialect, when it was translated it foretold that support for animated vertices withing Unity3d would be released Dec 21, 2012.

Lic

LOL …thanx Dude (at least, you made me laugh :wink:

cheers

is there maybe a way in 3dsmax 2010 to collapse skin morph, skin and cat animation to a simple mesh animation?

Mike Cona on this forums has a morph addon

He doesn’t at the moment Hippo hes stopped selling it according to his signature. Been waiting to see if it comes back to life but it’s been a while now.

var targetMesh : Mesh; // Mesh we want to edit. Should be the mesh of the model this is applied to.

var targetMesh_base : Mesh; // Copy of that mesh, this is our base mesh, which the morphs will be applied to.
var targetMesh_morph1 : Mesh; // Morph map poses...
var targetMesh_morph2 : Mesh; // ...

private var targetVerts_base : Vector3[]; // Vertex positions of our base mesh.
private var targetVerts_morph1 : Vector3[]; // Vertex positions of our morph meshes...
private var targetVerts_morph2 : Vector3[]; // ...

private var tempVerts : Vector3[]; // Temporary holder for the vertex positions in the current morph state.

private var iDefault : float; // Length of while(i--) loop.

function Start() {
	// Load up the vertices.
	targetVerts_base = targetMesh_base.vertices;
	targetVerts_morph1 = targetMesh_morph1.vertices;
	targetVerts_morph2 = targetMesh_morph2.vertices;
	
	// Initialise the temporary holder and while() loop to be the correct length.
	tempVerts = new Vector3[targetMesh.vertices.Length];
	iDefault = targetMesh.vertices.Length;
	
	// Pre-subtract the default vertex positions from the morph vertex positions. Saves a calculation in the LateUpdate loop.
	// I've run it the i-- way as it's *far* faster than any other method and it isn't important that we do the vertices in numerical order.
	var i = iDefault;
	while (i--) {
		targetVerts_morph1[i] = targetVerts_morph1[i] - targetVerts_base[i];
		targetVerts_morph2[i] = targetVerts_morph2[i] - targetVerts_base[i];
	}
}

function LateUpdate() {

	// Depending on how many morph targets you have, this bit could be optimised to only calculate the non-zero morph strengths. As there's only two at the moment it hardly seems worth it.

	morph1Strength = Mathf.Sin(Time.time);
	morph2Strength = Mathf.Cos(Time.time);

	// Again, i-- method. This is where it really shines, as it's being called each frame and this method will give you a lot of FPS back.
	var i = iDefault;
	while (i--) {
		tempVerts[i] = targetVerts_base[i] - (targetVerts_morph1[i] * morph1Strength) - (targetVerts_morph2[i] * morph2Strength);
	}
	targetMesh.vertices = tempVerts;
}

This is the one I wrote for testing morphs on a skinned mesh - should work with non-skinned.

Note that you’ll need two copies of the mesh you want to modify.

One (the target mesh - the one applied to your model in-game) actually gets physically modified - this is a permanent change to the model until you re-import it manually. i.e. Any morphs applied will stay there even after you exit Play mode. This is why we have two base meshes.

The other (the base target mesh - identical in every respect, but doesn’t get modified, only copied from) is used as the reference to work out the original vertex positions of your target mesh.

http://forum.unity3d.com/threads/94140-3DS-Max-morph-to-Unity

Why is it far faster ?