Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

unwrap_UVW not working in loop

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
343 Views, 0 Replies

unwrap_UVW not working in loop

Hi,

 

I have to give fbx files (witch has several geometry objects) a second UV channel 2 and bake on this as 1 complete layout ( = so no overlapping between the several geometry) I use this to do it in maxscript:

 

select Geometry
addModifier selection (edit_poly())

uv_modifier = uvwunwrap()

addModifier selection (uv_modifier)
uv_modifier.unwrap.setMapChannel 2
uv_modifier.setFlattenSpacing 0.01
uv_modifier.flattenMapNoParams()

So the UVW is kinda instanced and it makes a nice distrubuted UV unwrap. It works when a run it in maxscript interface.

 

But when I run it like this:

 

aFiles = getfiles "D:/temp/Originals/*.fbx"
for f in aFiles do
(
ResetMaxFile #noPrompt
importfile f #NoPrompt

select Geometry
addModifier selection (edit_poly())
--Declare modifier
uv_modifier = uvwunwrap()
--Add it referenced
addModifier selection (uv_modifier)
uv_modifier.unwrap.setMapChannel 2
uv_modifier.setFlattenSpacing 0.01
uv_modifier.flattenMapNoParams()
convertTo selection Editable_Poly

completeFilePath = (getfilenamepath f + "Fixed/" + filenamefrompath f)
FBXExporterSetParam "ASCII" false
FBXExporterSetParam "FBX201300"
exportFile completeFilePath #noPrompt using:FBXEXP
)

 

It does not do the UV mapping correct, it makes wrong mapped stuff, but it makes a channel 2 dough. (I also cannot collapse the geometry cause we need the layered FBX for further processing)

 

So... who knows how to fix?

 

Thx Fabian

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report