Exporting from Maya - Weird Vodoo stuff (SOLVED)

So we are testing collada and exporting from Maya. We prepared ourselves that it would take some trial and error and yet we have long to go. So here is some questions and maybe even some bugs (?)

In Maya we created 2 separate Maya scenes with one object in each (turret and chassi)
They are UV mapped and only using the same texture.
To make it as simple and non error prone as possible I started out using the micro example that Sven provided with a Defold box being rendered.

Now I add them both as 2 models in 2 separate gameobjects. As we expected the scale is way out so I scale them up to 10,10,10 to even be able to see them next to the cube (fig 1)

(in render script the view is orthographic and I positioned the cam a little to better get a angle view)

Weird thing 1:
When compiling and running the scales are way different than being shown in editor. Tank models are rendered much bigger than cube even if using same material, predicate and draw function.

REALLY Weird thing 2:
If rotating the chassi gameobject (which has NO correlation with turret gameobject) in the editor. Eg like in image below I rotate chassi 45 degrees.
When compiling not only has the chassi rotated DOUBLE (90 degrees) BUT also the turret has rotated 45 degrees which makes no sense as they are 2 different gameobjects not parented and with 2 different models.

This also happens if rotating chassi runtime. Added this script ONLY on chassi object.
function init(self)
self.rot = 0
end

function update(self, dt)
	self.rot = self.rot + dt
	go.set_rotation(vmath.quat_rotation_y(self.rot))
end

Sooo… anyone wants to explain or maybe be added to our test project?

2 Likes

That does indeed look very strange. Please add me to the test project and we can have a look

johan.beck-noren[at]king.com

2 Likes

Thanks Johan. Added

When fiddling a little with unit (setting to meter) and pointing to same direction (Y = UP) I can see now that scale seems to be broken and is scaling double somehow?

1 Like

Looks strange! What material are you using, the built-in model.material?

If not, are you (incorrectly) applying the world matrix in the vertex shader for model material?

2 Likes

If I use the builtin material model.material it seems to work fine. The scale in the editor also matches in runtime with that material (I had to increase the scale to 100 to see the tank+turret in runtime).

Some time back we made some changes in where the transform is calculated for better batching. It might be an issue when using shaders written before this change was made. @sven do you recall which release this change was made in?

1 Like

Yes, it was in 1.2.100. :slight_smile:

2 Likes

Yep.
All the weird behaviour was due to that old material. Thanks for pointing it out!

/A

3 Likes