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