Home Technical Talk

Proportional Plane Error popups in Max 2010 :/

polycounter lvl 16
Offline / Send Message
Thewiruz polycounter lvl 16
hello i need help solving a problem.I downloaded “Proper plane over at scriptspot

http://www.scriptspot.com/3ds-max/proportiona l-plane

Not sure if it has to do with 64bits Max or Vista x64?Or Max 2010?

The script was posted 2006 and i keep getting errors during 3ds startup.
And the script notepad or whatever the name is keeps poping up in the lower left corner ending with the letters NUL in the end of the script which 3ds Max generates at startup.
The script seems to work but its annoying.
Can someone please look at the code and see if they find any errors.

May be something simple i dont know?Im not as coder besides HTML then :/
/*
ProportionalPlane v.1.1
(c) Jon Seagull 2005.  May be freely distributed, used, and modified.

bugs/questions/praise to [email]scripts@jonseagull.com[/email]

Automatically creates reference planes for modeling with the width and length wired
together, allowing the plane to be resized without losing bitmap proportions.

-Automatic material creation
-Choice of top/front/left orientation on create
-Customizable initial size based on either bitmap dimension
-Customizable name

added 1.1
-material name matches object name

*/

macroScript pPlane category:"JS Tools" buttonText:"pPlane" toolTip:"Proportional ImagePlane"
(   
   rollout pPlane "Proportional Plane" width:275 height:109
   (
      local theMap = bitmap 320 240 color:white
      
      button pickMap "Select Bitmap..." pos:[9,7] width:260 height:22
      radiobuttons lwSelect "" pos:[13,48] width:56 height:32 labels:#("Length", "Width") columns:1
      spinner size "" pos:[69,56] width:72 height:16 range:[1,999999,120] type:#worldunits scale:0.1
      button create "Create" pos:[220,38] width:48 height:65 enabled:false
      edittext nameField "Name: " pos:[15,82] width:142 height:16
      GroupBox grp1 "Creation Params" pos:[9,32] width:208 height:71
      radioButtons orientation "" pos:[167,52] width:37 height:48 columns:1 labels:#("Top", "Front", "Left")
         
      on pPlane open do nameField.text = uniqueName "ReferencePlane"
      
      on pickMap pressed do
      (
      local tempMap = selectBitmap caption:"Select Bitmap for Proportional Plane"
      if tempmap != undefined do (theMap = tempMap;pickmap.caption = theMap.filename;create.enabled = true)
      )
      
      on create pressed do
      (
      print themap.width
      print themap.height
      
      local planeRatio = (theMap.width as float)/(theMap.height as float)
      
      print planeratio
      
      --use length/width spinners to determine size
      if lwSelect.state == 1 then
         (
         local theLength = size.value
         local theWidth = theLength*PlaneRatio
         )
      else
         (
         local theWidth = size.value
         local theLength = theWidth*(1/PlaneRatio)
         )
         
      --build material
      local theMaterial = StandardMaterial selfIllumAmount:100
      theMaterial.diffusemap = bitmapTex bitmap:theMap
      showTextureMap theMaterial theMaterial.diffusemap on   
      assignNewName theMaterial
      
      --build plane
      local refPlane = plane name:namefield.text length:theLength width:theWidth lsegs:2 wsegs:2 mapCoords:true
      refplane.material = theMaterial
      refplane.material.name = refplane.name
         
      --wire parameters
      paramWire.connect2way refplane.baseobject[#width] refplane.baseobject[#length] ("length * " + planeratio as string) ("width / " + planeRatio as string)
      
      --position plane
      case orientation.state of
         (
         1:()
         2: (in coordsys (transmatrix refplane.transform.pos) refplane.rotation = (eulerangles -90 0 0))
         3: (in coordsys (transmatrix refplane.transform.pos) refplane.rotation = (eulerangles -90 90 0))
         )
      --clean up
      select refPlane
      nameField.text = uniqueName "ReferencePlane"
      )
   )
   createdialog pplane
)


I have posted for help on The Area but that forum is worthless,Noone seems to care

Thanks!

Replies

  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    can you post the exact error output from the maxscript listener (the notepad thingy) ?

    there is always the option to put some parts of the code in a try()catch() construct so that errors are not shown and instead remain silent in case the fails at some point.
    But since it just consists of a rollout with some buttons it would be better to know what part might misbehave hence the exact output.

    I will give the script later a try in 2009 32bit
  • Thewiruz
    Offline / Send Message
    Thewiruz polycounter lvl 16
    renderhjs i think its working with 2009 if im not mistaken?I believe someone confirmed that in another forum somewhere.People have e-mailed the guy who made the script but without success and that why i ask around for some help.
    The script seems to work after i close all these things poping up,I also get a dialogue window with the message

    -- unknown system exception and a OK button.


    I get 2 tabs poping up (notepad tabs) sort of.

    First

    pPlane_1_1.mcr
    macroScript pPlane category:"JS Tools" buttonText:"pPlane" toolTip:"Proportional ImagePlane"
    (	
    	rollout pPlane "Proportional Plane" width:275 height:109
    	(
    		local theMap = bitmap 320 240 color:white
    		
    		button pickMap "Select Bitmap..." pos:[9,7] width:260 height:22
    		radiobuttons lwSelect "" pos:[13,48] width:56 height:32 labels:#("Length", "Width") columns:1
    		spinner size "" pos:[69,56] width:72 height:16 range:[1,999999,120] type:#worldunits scale:0.1
    		button create "Create" pos:[220,38] width:48 height:65 enabled:false
    		edittext nameField "Name: " pos:[15,82] width:142 height:16
    		GroupBox grp1 "Creation Params" pos:[9,32] width:208 height:71
    		radioButtons orientation "" pos:[167,52] width:37 height:48 columns:1 labels:#("Top", "Front", "Left")
    			
    		on pPlane open do nameField.text = uniqueName "ReferencePlane"
    		
    		on pickMap pressed do
    		(
    		local tempMap = selectBitmap caption:"Select Bitmap for Proportional Plane"
    		if tempmap != undefined do (theMap = tempMap;pickmap.caption = theMap.filename;create.enabled = true)
    		)
    		
    		on create pressed do
    		(
    		print themap.width
    		print themap.height
    		
    		local planeRatio = (theMap.width as float)/(theMap.height as float)
    		
    		print planeratio
    		
    		--use length/width spinners to determine size
    		if lwSelect.state == 1 then
    			(
    			local theLength = size.value
    			local theWidth = theLength*PlaneRatio
    			)
    		else
    			(
    			local theWidth = size.value
    			local theLength = theWidth*(1/PlaneRatio)
    			)
    			
    		--build material
    		local theMaterial = StandardMaterial selfIllumAmount:100 
    		theMaterial.diffusemap = bitmapTex bitmap:theMap
    		showTextureMap theMaterial theMaterial.diffusemap on	
    		assignNewName theMaterial
    		
    		--build plane
    		local refPlane = plane name:namefield.text length:theLength width:theWidth lsegs:2 wsegs:2 mapCoords:true
    		refplane.material = theMaterial
    		refplane.material.name = refplane.name
    			
    		--wire parameters
    		paramWire.connect2way refplane.baseobject[#width] refplane.baseobject[#length] ("length * " + planeratio as string) ("width / " + planeRatio as string)
    		
    		--position plane
    		case orientation.state of
    			(
    			1:()
    			2: (in coordsys (transmatrix refplane.transform.pos) refplane.rotation = (eulerangles -90 0 0))
    			3: (in coordsys (transmatrix refplane.transform.pos) refplane.rotation = (eulerangles -90 90 0))
    			)
    		--clean up
    		select refPlane
    		nameField.text = uniqueName "ReferencePlane"
    		)
    	)
    	createdialog pplane
    )
    


    Then

    JS Tools-Pplane.mcr
    macroScript pPlane category:"JS Tools" buttonText:"pPlane" toolTip:"Proportional ImagePlane"
    (	
    	rollout pPlane "Proportional Plane" width:275 height:109
    	(
    		local theMap = bitmap 320 240 color:white
    		
    		button pickMap "Select Bitmap..." pos:[9,7] width:260 height:22
    		radiobuttons lwSelect "" pos:[13,48] width:56 height:32 labels:#("Length", "Width") columns:1
    		spinner size "" pos:[69,56] width:72 height:16 range:[1,999999,120] type:#worldunits scale:0.1
    		button create "Create" pos:[220,38] width:48 height:65 enabled:false
    		edittext nameField "Name: " pos:[15,82] width:142 height:16
    		GroupBox grp1 "Creation Params" pos:[9,32] width:208 height:71
    		radioButtons orientation "" pos:[167,52] width:37 height:48 columns:1 labels:#("Top", "Front", "Left")
    			
    		on pPlane open do nameField.text = uniqueName "ReferencePlane"
    		
    		on pickMap pressed do
    		(
    		local tempMap = selectBitmap caption:"Select Bitmap for Proportional Plane"
    		if tempmap != undefined do (theMap = tempMap;pickmap.caption = theMap.filename;create.enabled = true)
    		)
    		
    		on create pressed do
    		(
    		print themap.width
    		print themap.height
    		
    		local planeRatio = (theMap.width as float)/(theMap.height as float)
    		
    		print planeratio
    		
    		--use length/width spinners to determine size
    		if lwSelect.state == 1 then
    			(
    			local theLength = size.value
    			local theWidth = theLength*PlaneRatio
    			)
    		else
    			(
    			local theWidth = size.value
    			local theLength = theWidth*(1/PlaneRatio)
    			)
    			
    		--build material
    		local theMaterial = StandardMaterial selfIllumAmount:100 
    		theMaterial.diffusemap = bitmapTex bitmap:theMap
    		showTextureMap theMaterial theMaterial.diffusemap on	
    		assignNewName theMaterial
    		
    		--build plane
    		local refPlane = plane name:namefield.text length:theLength width:theWidth lsegs:2 wsegs:2 mapCoords:true
    		refplane.material = theMaterial
    		refplane.material.name = refplane.name
    			
    		--wire parameters
    		paramWire.connect2way refplane.baseobject[#width] refplane.baseobject[#length] ("length * " + planeratio as string) ("width / " + planeRatio as string)
    		
    		--position plane
    		case orientation.state of
    			(
    			1:()
    			2: (in coordsys (transmatrix refplane.transform.pos) refplane.rotation = (eulerangles -90 0 0))
    			3: (in coordsys (transmatrix refplane.transform.pos) refplane.rotation = (eulerangles -90 90 0))
    			)
    		--clean up
    		select refPlane
    		nameField.text = uniqueName "ReferencePlane"
    		)
    	)
    	createdialog pplane
    )
    
Sign In or Register to comment.