imported blender obj into max

carsol's icon

hi...

im just starting to use obj models in jitter and learning blender and i have a very newbie question.

if i export the default cube of blender which is 8 vertices/12 tris, when i import it into Jitter
i get 24 vertices/12 tris and if i use matrixoutput the resulting matrix have a dim of 36 cells (tris*3). Is this normal?

thanks!

Andro's icon

Hi Carsol.
A few tips when exporting from blender into Max.
-If you didn't use the triangulate modifier (end of the modifier chain) results can vary on export, plus Jitter is happiest with tri's not quads.
-Go into edit mode with the object, select everything with "a", then select remove doubles. This removes any vertexs that are in the same location.
-Use Collada, on export use selection only + export with modifiers for non destructive exporting.You can also export the model with textures and UV wrapping data.
-the 36 dim output is probably because its sending out the xyz data for each vertex, 3 * 12.
- If you have trouble seeing a model send the message "draw_primitives triangles" to jit.gl.render.
-Also don't forget to put set the following "jit.gl.model optimize 0" otherwise max will attempt to remove any vertexes that are double.

Hopefully that'll get you going.

Rob Ramirez's icon

hi andro. thanks much for posting these tips.
i've created a wiki page to capture this. please feel free to edit:
https://cycling74.com/wiki/index.php?title=Exporting_Blender_Models

Andro's icon

Thanks Rob. I'll go through the forums and grab the best posts relating to this topic and get them all in one place.

carsol's icon

Hi Andro, thank you very much by the ninja tricks!
great the Wiki!!

about the vertex number, each of the planes xyz have a 36 dim, so
i guess the difference of vertices in the cube is related to the fact that for a quad face is 4 vertex and using 2 triangles is needed 6 vertices

Rob, maybe in the future gl.model will be happy with quads? in terms of performance seems a huge step, no?

thanks!

Andro's icon

Hi Carsol,
Glad the wiki can help you out.
I'm not too sure but I think with the tris that certain vertexes can "overlap", I'm a little bit rusty with how drawing tri's works. Maybe a good idea to check the jit.gl.sketch help file as it has clear examples on how to draw a shape with tri's from scratch.

Jitter can run with quads, its just not the best or most efficient way to do it.
But if your model is low poly then it shouldn't be a problem at all.
I wouldn't worry about the amount of vertexes :)
Just manipulating a mesh to transform correctly is challenge enough.
To get you started try this.
Go into blender make a cube and subdivide it two times.
Make some alterations to the shape.
go to edit mode. remove double vertexes.
add a triangulate modifier. Apply it.
Now duplicate the model with shift+d.
Alter this one BUT don't remove any vertexes,edges or faces.
Now load those two into Rob's example patch.
Try crossfading between them with jit.xfade.
This should work fine with morphing from one mesh to another.
If it doesn't give a shout post a patch and we'll work from there.
alter the model again so its different

carsol's icon

Hi Andro,

im trying to use good looking complex 3d models (25k verts/50k tris in Blender what ends in 150k dim matrices in Jitter) and render in realtime at 60fps with matrixoutput=1 for vertices displacements, audio sync, textures etc... so no way to don't be worried with vertexs, mostly when im not a shader programmer and almost either gen... :,)

thanks!
o

Andro's icon

Hi Carsol,
50k tris ! Well thats either the best sculpt you can make or an "inefficient" model :) Not meant bad.
Have you tried using the decimate modifier or in edit mode "dissolve" (with an angle setting of 30) to reduce your poly count ?
The remesh modifier is also really good (with remove connected faces deselected,Octave 4 to 6) but very heavy on the cpu , don't be surprised if you have to give your computer a few minutes to process it. As long as blender doesn't crash then its working, I've had to wait ten minutes for one high poly model.
I've found that using decimate 0.75 > remesh > decimate > 0.5 can give pretty good results, you can replace remesh with the "dissolve" effect to see what gives better results.

Zbrush has the best remesh modifier I've ever worked with, sadly its not for free.
Check this video to see what I mean with how you can reduce the poly count but still keep the model close to its original form.
http://pixologic.com/zbrush/features/ZBrush4R7/

Hopefully that helps out with model optimisation !

carsol's icon

probably i like too much smooth curvy complex surfaces.... ;)

thank you very much for the tips i will give a try...

carsol's icon

Hello Andro, do you know what is need to be done in the exported model to be able use cull_face 1 and 2 attribute in Jitter? i tried recalculating the normals in Blender with CTRL+N but with cull_face 2 the object in Jitter disappears...

thanks!

Andro's icon

Thats To be expected. You normally only use cull face 1 to not draw the back. Cull face 2 removes the front. In blender go into edit mode TAB then press a then recalculate normals. Try flipping them as well. Screen shot ?