Home Technical Talk

[3ds Max] Seperate all elements to objects while keeping normals?

polycounter
Offline / Send Message
Davision3D polycounter
I found several Max scripts that seperate all elements to objects but none of those keep the mesh normals.

The only workflow that keeps the normals seems to be this:
-Clone the whole object
-Edit mesh, delete everything but one of the elements
-Repeat

This is for Destructible chunks that I need to import in UE4 seperated as objects. Now this can be 500-2000 chunks per asset so doing this manually like that would be kinda crazy.

If there is no solution for that Plan B could be to somehow project the old mesh normals on to all the seperated objects at once. But the steal normals scripts I found can't do that.

Any ideas?

Replies

  • Justo
    Offline / Send Message
    Justo polycounter
    Have you tried Soulburn's free ObjectDetacher script? I don't know if that keeps the mesh normals, but if I recall correctly, it does. 
  • Eric Chadwick
    I put some of my experimental results here on the wiki, might help you.
    http://wiki.polycount.com/wiki/Vertex_normal#3ds_Max

    Speciifically:
    If you add an Edit Normals modifier and make the normals Explicit, then go below it in the modifier stack and Detach as an Element, the normals will be preserved. This works with Editable Mesh, Edit Mesh, Editable Poly, and Edit Poly.


  • Noors
    Offline / Send Message
    Noors greentooth
    Looks like Soulburn is using detach function, so it probably breaks normals aswell.

    I do the same as you : copy the object and delete faces. Dealing with normals is painfuly slow.

    Works only for editable mesh. I did test on a simple object, so, if it does nothing, it's because it crashed :p

    
    
    fn getElements obj=
    (
    	f = obj.numfaces
    	elements = #()
    	done = #()
    	for i = 1 to f do
    	(
    		if (finditem done i) == 0 then 
    		(
    			faces = meshop.getElementsUsingFace obj #(i) as array
    			append elements faces
    			join done faces
    		)
    	)
    	return elements
    )
    
    try
    (
    	obj = selection[1]
    	objFaces = #{1..obj.numfaces}
    	elements = getElements obj
    
    	for i=1 to elements.count do
    	(
    		keepFaces = elements[i] as bitarray
    		delFaces = objFaces - keepFaces
    		newObj =  copy obj
    		meshop.deleteFaces newObj delfaces delIsoVerts:true
    		
    		--uncomment next line to center pivot 
    		--newObj.pivot = newObj.center
    	)
    )
    catch()
    
    <br>
  • Davision3D
    Offline / Send Message
    Davision3D polycounter
    Noors said:
    Looks like Soulburn is using detach function, so it probably breaks normals aswell.

    I do the same as you : copy the object and delete faces. Dealing with normals is painfuly slow.

    Works only for editable mesh. I did test on a simple object, so, if it does nothing, it's because it crashed :p

    
    
    fn getElements obj=
    (
    	f = obj.numfaces
    	elements = #()
    	done = #()
    	for i = 1 to f do
    	(
    		if (finditem done i) == 0 then 
    		(
    			faces = meshop.getElementsUsingFace obj #(i) as array
    			append elements faces
    			join done faces
    		)
    	)
    	return elements
    )
    
    try
    (
    	obj = selection[1]
    	objFaces = #{1..obj.numfaces}
    	elements = getElements obj
    
    	for i=1 to elements.count do
    	(
    		keepFaces = elements[i] as bitarray
    		delFaces = objFaces - keepFaces
    		newObj =  copy obj
    		meshop.deleteFaces newObj delfaces delIsoVerts:true
    		
    		--uncomment next line to center pivot 
    		--newObj.pivot = newObj.center
    	)
    )
    catch()
    
    <br>
    Thanks a lot, that works great!
    I put some of my experimental results here on the wiki, might help you.
    http://wiki.polycount.com/wiki/Vertex_normal#3ds_Max

    Speciifically:
    If you add an Edit Normals modifier and make the normals Explicit, then go below it in the modifier stack and Detach as an Element, the normals will be preserved. This works with Editable Mesh, Edit Mesh, Editable Poly, and Edit Poly.


    Yea, that wiki page was really helpful but making normals Explicit does not help in this case.
    Justo said:
    Have you tried Soulburn's free ObjectDetacher script? I don't know if that keeps the mesh normals, but if I recall correctly, it does. 
    Same problem with that script.
  • Larry
    Offline / Send Message
    Larry interpolator
    Have you tried face weighted normals script after you split them? In the end it's a pile of broken junk, does it look that bad in the engine with materlsa on them? I mean, nobody is going to notice
  • gandhics
    Offline / Send Message
    gandhics polycounter lvl 8
    Could u give me a small sample file for testing?
Sign In or Register to comment.