Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / max zoomext sel all
  RSS 2.0 ATOM  

max zoomext sel all
Rate this thread
 
63908
 
Permlink of this thread  
avatar
  • jprisbe
  • Posted: 26 January 2012 06:08 AM
  • Location: Grand Rapids, MI
  • Total Posts: 11
  • Joined: 19 January 2012 11:43 PM

I’ve written a small script to import a dwg file and render it to a png file.
I renders fine except there is too much surrounding white space in the png file.
I thought “max zoomext sel all” would fix it but it doesn’t.

Any suggestions?

Code below, image attached.

-- reset the scene, show no dialogs
resetMaxFile #noPrompt

-- load the scene file
loadMaxFile “C:\\Temp\\Symbols\\Scenes\\dwg2png2012.max”

-- import the file, show no dialogs
importFile “C:\\Users\\jprisbe\\AppData\\Local\\Temp\\STCPlotToPNG\\TXRA31.DWG” #noPrompt

-- select block
max select all

-- get selected block
selset = getCurrentSelection()

-- set the viewport to iso
viewport.setType #view_iso_user

-- apply material to selected object(s)
-- using default material passed to function
myMaterial = meditMaterials[2]

-- apply selected material to all objects selected
for obj in selset do obj.material = myMaterial

-- zoom entents
max zoomext sel all

render renderType:#blowup outputwidth:240 outputheight:240 force2sided:true outputfile:"c:\\temp\\symbols\\240x240\\test.png" vfb:false



Attachment Attachment
Replies: 0