EricChadwick
06-16-2006, 08:31 PM
I'm using output from the Macro Recorder, and it works for the most part. Only problem is it doesn't seem to be able to call the Pack UVs function.
As you can see, I'm totally inexperienced with MXS, but I am starting to take some first steps...
/*
This tool:
1. Copies the selected object.
2. Collapses to Editable Mesh.
3. Adds UVWMap set to 99.
4. Copies UV 1 to UV 99.
5. Sets the whole mesh to material ID 1.
6. Adds UVWUnwrap set to 99.
7. Selects all the faces.
8. Does a Recursive Pack.
*/
macroScript UV99_Prep
category:"Eric"
toolTip:"Prep uv 99"
buttonText:"uv99"
(
maxOps.cloneNodes $ cloneType:#copy newNodes:&nnl
select nnl -- select clone
modPanel.addModToSelection (Uvwmap ()) ui:on
$.modifiers[#UVW_Mapping].mapChannel = 99
macros.run "Tools" "Channel_Info"
channelInfo.Update ()
channelInfo.CopyChannel $ 3 1
channelInfo.PasteChannel $ 3 99
channelInfo.NameChannel $ 3 99 "-none-"
macros.run "Modifiers" "Material_ID"
$.modifiers[#Material].materialID = 1
macros.run "Modifier Stack" "Convert_to_Mesh"
modPanel.addModToSelection (Unwrap_UVW ()) ui:on
$.modifiers[#unwrap_uvw].unwrap.setMapChannel 99
subobjectLevel = 3
modPanel.setCurrentObject $.modifiers[#Unwrap_UVW]
subobjectLevel = 3
actionMan.executeAction 0 "40021" -- Selection: Select All
max select all
actionMan.executeAction 2077580866 "40074" -- All Commands: Pack
subobjectLevel = 3
)
Thanks for any help.
As you can see, I'm totally inexperienced with MXS, but I am starting to take some first steps...
/*
This tool:
1. Copies the selected object.
2. Collapses to Editable Mesh.
3. Adds UVWMap set to 99.
4. Copies UV 1 to UV 99.
5. Sets the whole mesh to material ID 1.
6. Adds UVWUnwrap set to 99.
7. Selects all the faces.
8. Does a Recursive Pack.
*/
macroScript UV99_Prep
category:"Eric"
toolTip:"Prep uv 99"
buttonText:"uv99"
(
maxOps.cloneNodes $ cloneType:#copy newNodes:&nnl
select nnl -- select clone
modPanel.addModToSelection (Uvwmap ()) ui:on
$.modifiers[#UVW_Mapping].mapChannel = 99
macros.run "Tools" "Channel_Info"
channelInfo.Update ()
channelInfo.CopyChannel $ 3 1
channelInfo.PasteChannel $ 3 99
channelInfo.NameChannel $ 3 99 "-none-"
macros.run "Modifiers" "Material_ID"
$.modifiers[#Material].materialID = 1
macros.run "Modifier Stack" "Convert_to_Mesh"
modPanel.addModToSelection (Unwrap_UVW ()) ui:on
$.modifiers[#unwrap_uvw].unwrap.setMapChannel 99
subobjectLevel = 3
modPanel.setCurrentObject $.modifiers[#Unwrap_UVW]
subobjectLevel = 3
actionMan.executeAction 0 "40021" -- Selection: Select All
max select all
actionMan.executeAction 2077580866 "40074" -- All Commands: Pack
subobjectLevel = 3
)
Thanks for any help.
