auto detect inverted model!

hi,

i have a problem with mesh normal. like when i attach together a model, sometimes the normal is inverted.i have to add a normal modifier to flip the whole model.
is there a trick to find out if the model is inverted or may be a way to avoid it when attaching them.i was thinking of finding out if most of the face normal are outward or not. please share your idea.thanks

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

Reset Negative Object Scale Values

This is more compact version

fn ResetNegativeScale backToOne:true =
(
	if selection.count != 0 do
	(
		for obj in selection do
		(
			if backToOne != true then
			(
				local ss = obj.scale
				if (ss.x < 0 or ss.y < 0 or ss.z < 0) do (obj.scale = point3 (abs ss.x) (abs ss.y) (abs ss.z))
			)
			else (if obj.scale != [1,1,1] do obj.scale = [1,1,1])
		)
	)
)

barigazy

barigazy's picture

Flipped (inverted) faces will

Flipped (inverted) faces will also happen when use mirror tool and then assign XForm modifier on it(ResetXForm).
The cause is negative scale value.
I use this before i perform attach or reset xform operation

if $.scale != [1,1,1] do $.scale = [1,1,1]
--or if you don't want to change scale number do this
ss = $.scale
if (ss.x < 0 or ss.y < 0 or ss.z < 0) do
($.scale = point3 (abs ss.x) (abs ss.y) (abs ss.z))

barigazy

zahidhasan's picture

thanks Barigazy . i will

i just checked it and it solved the problem. thanks a lot barigazy.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.