I'm attempting to script some of my monotonous work (basically the purpose of scripting) using GMax and maxscript. The first task I was looking to script was taking a box that I previously created and sized and turning that box into a simple hangar shape with its sides UVW Mapped, unwrapped and ready for copy/pasting into photoshop. Step 1 of this script would be to transform the box into the hangar shape. The method I learned to do this:
1. With box highlighted, convert box into editable poly.
2. Go to polygon selection mode (make sure Edged Faces selected by right-clicking on Perspective viewport) and select the box's top.
3. On Modify menu, enter value for Extrusion and select Extrude button to add a new extrusion on top of the box. This will become the roof.
4. Change to Vertex selection mode and highlight the 2 top vertices and select Collapse. Repeat for other top 2 vertices to create roof shape.
5. Change into polygon selection mode and scroll to bottom of Modify menu (under Surface Properties) to change the material IDs for the two new triangles on each peak of the roof from 1 (which is the roof's material ID) to match the material ID for the front and back of the hangar.
6. Delete the bottom poly (since it won't be needed nor textured).
Part II of my script would be to exit from polygon mode, select Modifier List dropdown-UVW Map and then Unwrap UVW. Select Edit button on Parameters menu to open Edit UVWs dialog. Select each side, then move to a designated spot for copy/paste into photoshop.
I tried to use the Macro Recorder to convert my actions to maxscript. For part I above, this is the result:
convertTo $ PolyMeshObject
$.useSubdivisionDisplacement = off
$.displaceSplitMesh = on
$.displaceMethod = 3
$.displaceSteps = 2
$.displaceEdge = 20
$.displaceDistance = 20
$.displaceAngle = 10
$.viewDependent = off
subobjectLevel = 4
select $.baseObject.faces[#{1}]
subobjectLevel = 1
set coordsys world
select $.baseObject.verts[#{9..10}]
select $.baseObject.verts[#{10..11}]
subobjectLevel = 4
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
actionMan.executeAction 0 "40020"
After saving the script and creating a new box to convert, I received unknown property errors for all of the $.baseObject.faces[#{}] lines of code. I also noticed that maxscript doesn't seem to see the values I enter in for the extrusion nor the face values. Is this a lost cause with maxscript? Does it not have the granularity to accomplish tasks like this? I could try to use autoit, but wanted to try maxscript first.
Thanks,
Eric
1. With box highlighted, convert box into editable poly.
2. Go to polygon selection mode (make sure Edged Faces selected by right-clicking on Perspective viewport) and select the box's top.
3. On Modify menu, enter value for Extrusion and select Extrude button to add a new extrusion on top of the box. This will become the roof.
4. Change to Vertex selection mode and highlight the 2 top vertices and select Collapse. Repeat for other top 2 vertices to create roof shape.
5. Change into polygon selection mode and scroll to bottom of Modify menu (under Surface Properties) to change the material IDs for the two new triangles on each peak of the roof from 1 (which is the roof's material ID) to match the material ID for the front and back of the hangar.
6. Delete the bottom poly (since it won't be needed nor textured).
Part II of my script would be to exit from polygon mode, select Modifier List dropdown-UVW Map and then Unwrap UVW. Select Edit button on Parameters menu to open Edit UVWs dialog. Select each side, then move to a designated spot for copy/paste into photoshop.
I tried to use the Macro Recorder to convert my actions to maxscript. For part I above, this is the result:
convertTo $ PolyMeshObject
$.useSubdivisionDisplacement = off
$.displaceSplitMesh = on
$.displaceMethod = 3
$.displaceSteps = 2
$.displaceEdge = 20
$.displaceDistance = 20
$.displaceAngle = 10
$.viewDependent = off
subobjectLevel = 4
select $.baseObject.faces[#{1}]
subobjectLevel = 1
set coordsys world
select $.baseObject.verts[#{9..10}]
select $.baseObject.verts[#{10..11}]
subobjectLevel = 4
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
actionMan.executeAction 0 "40020"
After saving the script and creating a new box to convert, I received unknown property errors for all of the $.baseObject.faces[#{}] lines of code. I also noticed that maxscript doesn't seem to see the values I enter in for the extrusion nor the face values. Is this a lost cause with maxscript? Does it not have the granularity to accomplish tasks like this? I could try to use autoit, but wanted to try maxscript first.
Thanks,
Eric

