--Written by Dave Wortley -- --I take no responsibility if this breaks your file/max/computer/marraige/sex life/health. --If you like it, please all I ask is that you share the link and give it a thumbs up, and maybe I'll make more better things. -- --Replaces the modal object properties window with an interactive non-modal one. -- --Version 1.1 Mod by PaleBlue.Design --renamed "Trajectory" to "Motion Path" --removed legacy Mental Ray support --removed legacy "Put Material" button --fixed minor UI layout bugs --fixed accessing Vray Tab overriding User Defined properties --fixed spinner undo for each value change --fixed scale spinners should affect the object scale --added rotation spinners --added locking for position, scale and rotation --fixed targeted objects rotation bug --fixed face and vertex counts for native geometry objects --added spline vertex and segment counts --added multiselection instanced properties support --updated vray properties dialogs: "Moblur duration", Motion blur "Velocity channel", Motion blur "Velocity channel multiplier", "Raytraced SSS ID", "VRayToon outlines", "Generate render elements" --fixed error for maxscript search when no more items are to be found --TODO: add buttons to materials, layers and parents that will display a list or a table with all instances of that property when multiple objects are selected. constraint prompt if over n results. --Version 1.0 --Updated Vray Properties to latest Vray --made into MCR --added XRef Info --added Undo system, but doesn't seem to work for all settings.... --version 0.9 --added Adv lighting tab --added Vray Tab! --added vray light props tab. --remembers what tab you were using --Fixed a scope bug --version 0.7 --added user defined props --added maxscript panel with lots of goodies! --fixed a few little bugs --version 0.5 --fixed issue with verts/faces/material name not updating, layername not updating -- --known issues, no animation key brackets on visibility if visibility is animated --Undo doesn't work with everything...Might be max's fault -- -- --Installation --Copy this into your... --C:\Documents and Settings\xxxxxxxxxxxxx\Local Settings\Application Data\Autodesk\3dsMax\20xx - 64bit\enu\UI\usermacros --or whatever folder --restart max (seriously why do we have to do that, soo annoying!) --Goto Customize -> customise User interface -> Quads --Change Category to 'DW Tools' --Drag the 'Object Properties 2.0' to just below the 'Properties' in the quad list... --Get rid of the other one at your peril, I'd keep both for now just for backup if I were you. -- --PLEASE Report bugs! --http://forums.cgsociety.org/showthread.php?f=6&t=1064375 -- -- and visit my blog for instructions on how to better yourself with maxscript knowledge. --http://davewortley.wordpress.com macroScript DWObjProps category:"DW Tools" buttontext:"Object Properties 2.0" tooltip:"Object Properties 2.0" ( Try(DestroyDialog DL_ObjsProp)catch() global DWObjPropsVersion = "Object Properties 2.0.1.1" global DWOBjsMatString = stringstream "" if ::DWObjPropsTab == undefined do global DWObjPropsTab = 1 persistent global DW_ObjPropsPos if DW_ObjPropsPos == undefined do DW_ObjPropsPos = [400,400] global RL_ObjsProp, RL_AdvLighting, RL_UserDef, RL_Vray, RL_VrayLightProps, RL_maxscript rollout RL_ObjsProp "Object Properties" width:460 height:606 ( edittext edt_name "Name:" pos:[13,22] width:381 height:17 colorPicker clp_Wirecolor "" pos:[394,21] width:44 height:20 color:(color 16 16 16) label lbl1 "Size:" pos:[25,47] width:61 height:13 edittext edt_X "X:" pos:[13,64] width:90 height:17 enabled:true readOnly:true edittext edt_Y "Y:" pos:[13,85] width:90 height:17 enabled:true readOnly:true edittext edt_Z "Z:" pos:[13,106] width:90 height:17 enabled:true readOnly:true label lbl2 "Position:" pos:[123,47] width:61 height:13 spinner spn_posX "X:" pos:[119,64] width:95 height:17 type:#worldunits range:[-1e9,1e9,0] spinner spn_posY "Y:" pos:[119,85] width:95 height:17 type:#worldunits range:[-1e9,1e9,0] spinner spn_posZ "Z:" pos:[119,106] width:95 height:17 type:#worldunits range:[-1e9,1e9,0] checkbutton btn_LckPosX "L" pos:[215,64] width:17 height:17 checkbutton btn_LckPosY "L" pos:[215,85] width:17 height:17 checkbutton btn_LckPosZ "L" pos:[215,106] width:17 height:17 label lbl4 "Rotation:" pos:[256,47] width:65 height:13 spinner spn_RotX "X:" pos:[252,64] width:65 height:17 range:[-1e9,1e9,0] spinner spn_RotY "Y:" pos:[252,85] width:65 height:17 range:[-1e9,1e9,0] spinner spn_RotZ "Z:" pos:[252,106] width:65 height:17 range:[-1e9,1e9,0] checkbutton btn_LckRotX "L" pos:[318,64] width:17 height:17 checkbutton btn_LckRotY "L" pos:[318,85] width:17 height:17 checkbutton btn_LckRotZ "L" pos:[318,106] width:17 height:17 label lbl3 "Scale:" pos:[359,47] width:65 height:13 spinner spn_ScaleX "X:" pos:[355,64] width:65 height:17 range:[-1e9,1e9,0] spinner spn_ScaleY "Y:" pos:[355,85] width:65 height:17 range:[-1e9,1e9,0] spinner spn_ScaleZ "Z:" pos:[355,106] width:65 height:17 range:[-1e9,1e9,0] checkbutton btn_LckScaX "L" pos:[421,64] width:17 height:17 checkbutton btn_LckScaY "L" pos:[421,85] width:17 height:17 checkbutton btn_LckScaZ "L" pos:[421,106] width:17 height:17 --edittext edt_depth "Depth" pos:[380,85] width:60 height:17 enabled:true readOnly:true edittext edt_Vertices "Verts: " pos:[13,130] width:90 height:17 enabled:true readOnly:true edittext edt_layername "Layer: " pos:[112,130] width:325 height:17 enabled:true readOnly:true edittext edt_Faces "Faces:" pos:[13,153] width:90 height:17 enabled:true readOnly:true edittext edt_Parent "Parent:" pos:[112,153] width:209 height:17 enabled:true readOnly:true edittext edt_NumChildren "Num.Children:" pos:[330,153] width:106 height:17 enabled:true readOnly:true edittext edt_XRef "Xref File:" pos:[13,175] width:423 height:17 enabled:true readOnly:true edittext edt_matname "Material: " pos:[13,197] width:423 height:17 enabled:true readOnly:true local spinnerStartPosX, spinnerStartPosY, spinnerStartPosZ local spinnerStartRotX, spinnerStartRotY, spinnerStartRotZ local spinnerStartRotationX, spinnerStartRotationY, spinnerStartRotationZ local spinnerStartPivotX, spinnerStartPivotY, spinnerStartPivotZ local spinnerRotDraggingX = false, spinnerRotDraggingY = false, spinnerRotDraggingZ = false local spinnerStartScaleX, spinnerStartScaleY, spinnerStartScaleZ local spinnerStartMapChannel, spinnerStartVisibility local spinnerStartGBuffer, spinnerStartMotionBlurMultiplier checkbox chk_hide "Hide" pos:[13,248] width:46 height:15 checkbox chk_Freeze "Freeze" pos:[13,267] width:56 height:15 button btn_DpbyLayer "By Layer" pos:[132,315] width:57 height:21 checkbox chk_SeeThrough "See-Through" pos:[13,315] width:86 height:15 checkbox chk_boxmode "Display as Box" pos:[13,335] width:93 height:15 checkbox chk_BackfaceCull "Backface Cull" pos:[13,355] width:90 height:15 checkbox chk_EdgesOnly "Edges Only" pos:[13,375] width:78 height:15 checkbox chk_VertexTicks "Vertex Ticks" pos:[13,395] width:83 height:15 checkbox chk_Trajectory "Motion Path" pos:[13,415] width:71 height:15 checkbox chk_IgnoreExtents "Ignore Extents" pos:[13,435] width:92 height:15 checkbox chk_ShowFrozeninGray "Show Frozen in Gray" pos:[13,455] width:122 height:15 checkbox chk_NeverDegrade "Never Degrade" pos:[13,475] width:97 height:15 checkbox chk_VertexChannelDisplay "Vertex Channel Display" pos:[13,495] width:133 height:15 dropdownList ddl_VertexDisplayMode "" pos:[13,515] width:136 height:21 items:#("Vertex Color", "Vertex Illumination", "Vertex Alpha", "Map Channel Color", "Soft Selection Color") checkbutton btn_Shaded "Shaded" pos:[150,514] width:57 height:21 spinner spn_mapchannel "Map Channel:" pos:[100,541] width:106 height:16 range:[1,99,1] type:#integer button btn_RPbyLayer "By Layer" pos:[369,252] width:57 height:21 spinner spn_Visibility "Visibility: " pos:[284,254] width:75 height:16 range:[0,1,1] type:#float --setKeyBrackets:true --setKeyBrackets:true checkbox chk_renderable "Renderable" pos:[243,275] width:79 height:15 checkbox chk_inherit "Inherit Visibility" pos:[243,295] width:92 height:15 checkbox chk_PrimVis "Visible to Camera" pos:[243,315] width:105 height:15 checkbox chk_SecondVis "Visible to Reflection/Refraction" pos:[243,335] width:171 height:15 checkbox chk_ReceiveShadows "Receive Shadows" pos:[243,355] width:111 height:15 checkbox chk_CastShadows "Cast Shadows" pos:[243,375] width:92 height:15 checkbox chk_applyatmospherics "Apply Atmospherics" pos:[243,395] width:116 height:15 checkbox chk_RenderOccluded "Render Occluded Objects" pos:[243,415] width:147 height:15 spinner spn_gbuffer "Object ID" pos:[278,460] width:92 height:16 range:[0,1000,1] type:#integer spinner spn_MbMultiplier "Multiplier" pos:[279,506] width:91 height:16 button btn_mbByLayer "By Layer" pos:[379,505] width:57 height:21 checkbox chk_MbEnabled "Enabled" pos:[251,527] width:63 height:15 radiobuttons rdo_MbMode "" pos:[248,547] width:184 height:16 labels:#("None", "Object", "Image") columns:3 GroupBox grp1 "Object Information" pos:[3,2] width:442 height:220 GroupBox grp2 "Interactivity" pos:[4,227] width:205 height:63 GroupBox grp3 "Display Properties" pos:[2,295] width:207 height:272 GroupBox grp4 "Rendering Control" pos:[224,229] width:222 height:206 GroupBox grp5 "G-Buffer" pos:[224,439] width:222 height:45 GroupBox grp6 "Motion Blur" pos:[225,487] width:220 height:79 --button btn_close "Close" pos:[315,534] width:131 height:26 fn getprop thecontrol theProp = ( local theVal = getproperty selection[1] theProp local testVal = theVal for o in selection while testVal == theVal do ( if theval != (getproperty o theProp) then testVal = (getproperty o theProp) ) if testVal == theVal then ( if theVal then thecontrol.tristate = 1 else thecontrol.tristate = 0 ) else ( thecontrol.tristate = 2 ) ) fn ToggleDisplayProps s = ( chk_SeeThrough.enabled = s chk_boxmode.enabled = s chk_BackfaceCull.enabled = s chk_EdgesOnly.enabled = s chk_VertexTicks.enabled = s chk_Trajectory.enabled = s chk_IgnoreExtents.enabled = s chk_ShowFrozeninGray.enabled = s chk_NeverDegrade.enabled = s chk_VertexChannelDisplay.enabled = s ddl_VertexDisplayMode.enabled = s btn_Shaded.enabled = s if s and ddl_VertexDisplaymode.selection != 4 then ( spn_mapchannel.enabled = false ) else spn_mapchannel.enabled = s ) fn ToggleRenderProps s = ( spn_visibility.enabled = s chk_renderable.enabled = s chk_inherit.enabled = s chk_PrimVis.enabled = s chk_SecondVis.enabled = s chk_ReceiveShadows.enabled = s chk_CastShadows.enabled = s chk_applyatmospherics.enabled = s chk_RenderOccluded.enabled = s ) fn GetNodeRotation theNode = ( local nodeTransform = theNode.transform local rotationTransform = matrix3 (normalize nodeTransform.row1) (normalize nodeTransform.row2) (normalize nodeTransform.row3) nodeTransform.translation rotationTransform as quat ) fn SetNodeRotation theNode targetRotation pivotPosition = ( local currentTransform = theNode.transform local targetTransform = (targetRotation as quat) as matrix3 targetTransform.row1 *= length currentTransform.row1 targetTransform.row2 *= length currentTransform.row2 targetTransform.row3 *= length currentTransform.row3 targetTransform.translation = currentTransform.translation theNode.transform = targetTransform in coordsys world move theNode (pivotPosition - theNode.pivot) ) fn ToggleMbProps s = ( chk_MbEnabled.enabled = s rdo_MbMode.enabled = s if rdo_MbMode.state != 3 then spn_MbMultiplier.enabled = false else spn_mbMultiplier.enabled = s ) fn UpdateTransformLocks = ( local lockControls = #(btn_LckPosX, btn_LckPosY, btn_LckPosZ, btn_LckRotX, btn_LckRotY, btn_LckRotZ, btn_LckScaX, btn_LckScaY, btn_LckScaZ) local transformSpinners = #(spn_posX, spn_posY, spn_posZ, spn_RotX, spn_RotY, spn_RotZ, spn_ScaleX, spn_ScaleY, spn_ScaleZ) local lockFlags = if selection.count == 1 then getTransformLockFlags selection[1] else #{ } if selection.count == 1 then ( for i = 1 to lockControls.count do ( local isLocked = lockFlags[i] lockControls[i].checked = isLocked lockControls[i].enabled = true transformSpinners[i].enabled = not isLocked ) ) else ( for control in lockControls do ( control.checked = false control.enabled = false ) ) ) fn ToggleTransformLock lockIndex = ( if selection.count == 1 then ( local lockFlags = getTransformLockFlags selection[1] lockFlags[lockIndex] = not lockFlags[lockIndex] undo "Object Properties - Transform Lock" on setTransformLockFlags selection[1] lockFlags UpdateTransformLocks() ) ) fn UpdateSel = ( if selection.count != 0 then ( for o in RL_ObjsProp.controls do o.enabled = true if selection.count == 1 then ( edt_name.text = selection[1].name edt_name.readonly = false if selection[1].material != undefined then edt_matname.text = selection[1].material.name else edt_matname.text = "None" edt_layername.text = selection[1].layer.name if selection[1].parent != undefined then edt_parent.text = selection[1].parent.name else edt_parent.text = "Scene Root" edt_numchildren.text = selection[1].children.count as string if classof selection[1] == XrefObject then edt_Xref.text = getfilenamefile (selection[1].filename) + ".max" else edt_XRef.text = "" local thefacecount = "" local thevertcount = "" if isShapeObject selection[1] then ( local splineCount = numSplines selection[1] thevertcount = 0 thefacecount = 0 for splineIndex = 1 to splineCount do ( thevertcount += numKnots selection[1] splineIndex thefacecount += numSegments selection[1] splineIndex ) ) else if classof selection[1] == Editable_poly then ( thefacecount = selection[1].faces.count thevertcount = selection[1].vertices.count ) else if superclassof selection[1] == GeometryClass then ( local evaluatedMesh = snapshotAsMesh selection[1] thefacecount = evaluatedMesh.numfaces thevertcount = evaluatedMesh.numverts ) edt_vertices.text = thevertcount as string edt_faces.text = thefacecount as string objLocalBBox= in coordsys local nodeLocalBoundingBox selection[1] olbb = objLocalBBox[2] - objLocalBBox[1] edt_x.text = units.formatValue olbb[1] edt_y.text = units.formatValue olbb[2] edt_z.text = units.formatValue olbb[3] --format "width:% length:% height:%\n" w l h spn_posX.value = selection[1].transform.pos.x spn_posY.value = selection[1].transform.pos.y spn_posZ.value = selection[1].transform.pos.z local objectRotation = quatToEuler (GetNodeRotation selection[1]) spn_RotX.value = objectRotation.x spn_RotY.value = objectRotation.y spn_RotZ.value = objectRotation.z spn_scaleX.value = selection[1].scale.x * 100 spn_scaleY.value = selection[1].scale.y * 100 spn_scaleZ.value = selection[1].scale.z * 100 ) else ( edt_name.text = ("[" + selection.count as string + " objects selected]") edt_name.readonly = true local selectedLayers = #() local selectedParents = #() local selectedMaterials = #() for selectedObject in selection do ( appendIfUnique selectedLayers selectedObject.layer appendIfUnique selectedParents selectedObject.parent appendIfUnique selectedMaterials selectedObject.material ) if selectedLayers.count == 1 then edt_layername.text = selectedLayers[1].name else edt_layername.text = "[" + selectedLayers.count as string + " layers]" if selectedParents.count == 1 then ( if selectedParents[1] != undefined then edt_parent.text = selectedParents[1].name else edt_parent.text = "Scene Root" ) else edt_parent.text = "[" + selectedParents.count as string + " parents]" if selectedMaterials.count == 1 then ( if selectedMaterials[1] != undefined then edt_matname.text = selectedMaterials[1].name else edt_matname.text = "None" ) else edt_matname.text = "[" + selectedMaterials.count as string + " materials]" edt_vertices.text = "" edt_faces.text = "" edt_Xref.text = "" edt_numchildren.text = "" edt_x.text = "" edt_y.text = "" edt_z.text = "" spn_posX.indeterminate = true spn_posY.indeterminate = true spn_posZ.indeterminate = true spn_posX.enabled = false spn_posY.enabled = false spn_posZ.enabled = false spn_RotX.indeterminate = true spn_RotY.indeterminate = true spn_RotZ.indeterminate = true spn_RotX.enabled = false spn_RotY.enabled = false spn_RotZ.enabled = false spn_scaleX.indeterminate = true spn_scaleY.indeterminate = true spn_scaleZ.indeterminate = true spn_scaleX.enabled = false spn_scaleY.enabled = false spn_scaleZ.enabled = false ) UpdateTransformLocks() clp_wirecolor.color = selection[1].wireColor --edt_x.text = units.formatValue (selection.max.x - selection.min.x) --edt_y.text = units.formatValue (selection.max.y - selection.min.y) --edt_z.text = units.formatValue (selection.max.z - selection.min.z) --edt_vertices.text = obj.vertices.count as string --edt_faces.text = obj.faces.count as string getprop chk_hide "ishidden" getprop chk_freeze "isfrozen" getprop chk_SeeThrough "xray" getprop chk_boxmode "boxMode" getprop chk_BackfaceCull "backFaceCull" getprop chk_EdgesOnly "allEdges" chk_EdgesOnly.checked = not chk_EdgesOnly.checked getprop chk_VertexTicks "vertexTicks" getprop chk_Trajectory "showTrajectory" getprop chk_IgnoreExtents "ignoreExtents" getprop chk_ShowFrozeninGray "showFrozenInGray" getprop chk_NeverDegrade "neverdegrade" getprop chk_VertexChannelDisplay "showVertexColors" btn_shaded.checked = selection[1].vertexColorsShaded getprop chk_renderable "renderable" getprop chk_inherit "inheritVisibility" getprop chk_PrimVis "primaryVisibility" getprop chk_SecondVis "secondaryVisibility" getprop chk_ReceiveShadows "Receiveshadows" getprop chk_CastShadows"castshadows" getprop chk_applyatmospherics "applyatmospherics" getprop chk_RenderOccluded "renderoccluded" --vertexColorType enums: {#color|#illum|#alpha|#color_plus_illum} --items:#("Vertex Color", "Vertex Illumination", "Vertex Alpha", "Map Channel Color", "Soft Selection Color") ddl_VertexDisplayMode.selection = Case selection[1].vertexColorType of ( #color: 1 #illum: 2 #alpha: 3 #color_plus_illum: 4 #soft_select: 5 default: 1 ) spn_mapchannel.value = selection[1].vertexColorMapChannel --btn_mbByLayer local s = true local same = true local value = selection[1].motionByLayer for o in selection while same do same = o.motionByLayer == value if not same then ( btn_mbByLayer.caption = "Mixed" s = false ) else ( if value then ( s = false btn_mbByLayer.caption = "By Layer" ) else ( s = true btn_mbByLayer.caption = "By Object" ) ) spn_MbMultiplier.value = selection[1].imageMotionBlurMultiplier chk_MbEnabled.checked = selection[1].motionBlurOn rdo_MbMode.state = Case selection[1].motionBlur of ( #none: 1 #object: 2 #image: 3 ) ToggleMbProps s local s = true local same = true local value = selection[1].displaybyLayer for o in selection while same do same = o.displaybyLayer == value --if not same .displaybyLayer then if not same then ( btn_DpByLayer.caption = "Mixed" s = false ) else ( if value then ( s = false btn_DpByLayer.caption = "By Layer" ) else ( s = true btn_DPByLayer.caption = "By Object" ) ) ToggleDisplayProps s local s = true local same = true local value = selection[1].renderbyLayer for o in selection while same do same = o.renderbyLayer == value if not same then ( btn_RPByLayer.caption = "Mixed" s = false ) else ( if value then ( s = false btn_RPByLayer.caption = "By Layer" ) else ( s = true btn_RPByLayer.caption = "By Object" ) ) if selection[1][1].controller == undefined then ( if selection[1].visibility = true then spn_Visibility.value = 1.0 else spn_Visibility.value = 0.0 ) else spn_Visibility.value = selection[1].visibility.controller.value ToggleRenderProps s if selection.count == 1 then spn_gbuffer.value = selection[1].gbufferchannel else ( local s = true local same = true local value = selection[1].gbufferchannel for o in selection while same do same = o.gbufferchannel == value if same then spn_gbuffer.value = selection[1].gbufferchannel else spn_gbuffer.indeterminate = true ) ) else ( for o in RL_ObjsProp.controls do o.enabled = false edt_name.text = "No object selected" edt_layername.text = "" edt_matname.text ="" edt_Xref.text = "" edt_X.text = "" edt_Y.text = "" edt_Z.text = "" edt_parent.text = "" edt_numChildren.text = "" UpdateTransformLocks() ) ) fn Updateobj theprop theState = ( with redraw off ( local s = ("Object Properties - " + theprop as string) undo s on for o in selection do setproperty o theprop thestate ) ) -- btn_mbByLayer on RL_ObjsProp open do ( UpdateSel() callbacks.addScript #selectionSetChanged "RL_ObjsProp.UpdateSel()" id:#DW_ObjProps callbacks.addScript #nodePostMaterial "RL_ObjsProp.UpdateSel()" id:#DW_ObjProps callbacks.addScript #sceneUndo "RL_ObjsProp.UpdateSel()" id:#DW_ObjProps registerTimeCallback RL_ObjsProp.UpdateSel ) on RL_ObjsProp close do ( callbacks.removescripts #selectionsetchanged id:#DW_ObjProps callbacks.removescripts #nodePostMaterial id:#DW_ObjProps callbacks.removescripts #sceneUndo id:#DW_ObjProps unRegisterTimeCallback RL_ObjsProp.UpdateSel ) on edt_name changed text do undo "Object Properties - Change Name" on selection[1].name = text on clp_Wirecolor changed col do updateobj "wirecolor" col on btn_LckPosX changed state do ToggleTransformLock 1 on btn_LckPosY changed state do ToggleTransformLock 2 on btn_LckPosZ changed state do ToggleTransformLock 3 on btn_LckRotX changed state do ToggleTransformLock 4 on btn_LckRotY changed state do ToggleTransformLock 5 on btn_LckRotZ changed state do ToggleTransformLock 6 on btn_LckScaX changed state do ToggleTransformLock 7 on btn_LckScaY changed state do ToggleTransformLock 8 on btn_LckScaZ changed state do ToggleTransformLock 9 on spn_posX buttondown do spinnerStartPosX = selection[1].pos.x on spn_posX changed val do undo off (selection[1].pos.x = val) on spn_posX buttonup do ( local finalValue = selection[1].pos.x undo off (selection[1].pos.x = spinnerStartPosX) undo "Object Properties - Pos X" on (selection[1].pos.x = finalValue) ) on spn_posY buttondown do spinnerStartPosY = selection[1].pos.y on spn_posY changed val do undo off (selection[1].pos.y = val) on spn_posY buttonup do ( local finalValue = selection[1].pos.y undo off (selection[1].pos.y = spinnerStartPosY) undo "Object Properties - Pos Y" on (selection[1].pos.y = finalValue) ) on spn_posZ buttondown do spinnerStartPosZ = selection[1].pos.z on spn_posZ changed val do undo off (selection[1].pos.z = val) on spn_posZ buttonup do ( local finalValue = selection[1].pos.z undo off (selection[1].pos.z = spinnerStartPosZ) undo "Object Properties - Pos Z" on (selection[1].pos.z = finalValue) ) on spn_RotX buttondown do ( spinnerRotDraggingX = true spinnerStartRotX = (quatToEuler (GetNodeRotation selection[1])).x spinnerStartRotationX = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotX = selection[1].pivot ) on spn_RotX changed val do ( if not spinnerRotDraggingX or spinnerStartRotationX == undefined do ( spinnerStartRotX = (quatToEuler (GetNodeRotation selection[1])).x spinnerStartRotationX = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotX = selection[1].pivot ) undo off ( SetNodeRotation selection[1] (eulerAngles val spinnerStartRotationX.y spinnerStartRotationX.z) spinnerStartPivotX ) if not spinnerRotDraggingX do spinnerStartRotationX = undefined ) on spn_RotX buttonup do ( local finalValue = spn_RotX.value if spinnerStartRotationX == undefined do ( spinnerStartRotX = (quatToEuler (GetNodeRotation selection[1])).x spinnerStartRotationX = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotX = selection[1].pivot ) undo off ( SetNodeRotation selection[1] (eulerAngles spinnerStartRotX spinnerStartRotationX.y spinnerStartRotationX.z) spinnerStartPivotX ) undo "Object Properties - Rot X" on ( SetNodeRotation selection[1] (eulerAngles finalValue spinnerStartRotationX.y spinnerStartRotationX.z) spinnerStartPivotX ) spinnerRotDraggingX = false spinnerStartRotationX = undefined ) on spn_RotY buttondown do ( spinnerRotDraggingY = true spinnerStartRotY = (quatToEuler (GetNodeRotation selection[1])).y spinnerStartRotationY = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotY = selection[1].pivot ) on spn_RotY changed val do ( if not spinnerRotDraggingY or spinnerStartRotationY == undefined do ( spinnerStartRotY = (quatToEuler (GetNodeRotation selection[1])).y spinnerStartRotationY = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotY = selection[1].pivot ) undo off ( SetNodeRotation selection[1] (eulerAngles spinnerStartRotationY.x val spinnerStartRotationY.z) spinnerStartPivotY ) if not spinnerRotDraggingY do spinnerStartRotationY = undefined ) on spn_RotY buttonup do ( local finalValue = spn_RotY.value if spinnerStartRotationY == undefined do ( spinnerStartRotY = (quatToEuler (GetNodeRotation selection[1])).y spinnerStartRotationY = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotY = selection[1].pivot ) undo off ( SetNodeRotation selection[1] (eulerAngles spinnerStartRotationY.x spinnerStartRotY spinnerStartRotationY.z) spinnerStartPivotY ) undo "Object Properties - Rot Y" on ( SetNodeRotation selection[1] (eulerAngles spinnerStartRotationY.x finalValue spinnerStartRotationY.z) spinnerStartPivotY ) spinnerRotDraggingY = false spinnerStartRotationY = undefined ) on spn_RotZ buttondown do ( spinnerRotDraggingZ = true spinnerStartRotZ = (quatToEuler (GetNodeRotation selection[1])).z spinnerStartRotationZ = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotZ = selection[1].pivot ) on spn_RotZ changed val do ( if not spinnerRotDraggingZ or spinnerStartRotationZ == undefined do ( spinnerStartRotZ = (quatToEuler (GetNodeRotation selection[1])).z spinnerStartRotationZ = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotZ = selection[1].pivot ) undo off ( SetNodeRotation selection[1] (eulerAngles spinnerStartRotationZ.x spinnerStartRotationZ.y val) spinnerStartPivotZ ) if not spinnerRotDraggingZ do spinnerStartRotationZ = undefined ) on spn_RotZ buttonup do ( local finalValue = spn_RotZ.value if spinnerStartRotationZ == undefined do ( spinnerStartRotZ = (quatToEuler (GetNodeRotation selection[1])).z spinnerStartRotationZ = quatToEuler (GetNodeRotation selection[1]) spinnerStartPivotZ = selection[1].pivot ) undo off ( SetNodeRotation selection[1] (eulerAngles spinnerStartRotationZ.x spinnerStartRotationZ.y spinnerStartRotZ) spinnerStartPivotZ ) undo "Object Properties - Rot Z" on ( SetNodeRotation selection[1] (eulerAngles spinnerStartRotationZ.x spinnerStartRotationZ.y finalValue) spinnerStartPivotZ ) spinnerRotDraggingZ = false spinnerStartRotationZ = undefined ) on spn_scaleX buttondown do spinnerStartScaleX = selection[1].scale.x on spn_scaleX changed val do undo off (selection[1].scale = [val / 100, selection[1].scale.y, selection[1].scale.z]) on spn_scaleX buttonup do ( local finalValue = selection[1].scale.x undo off (selection[1].scale = [spinnerStartScaleX, selection[1].scale.y, selection[1].scale.z]) undo "Object Properties - Scale X" on (selection[1].scale = [finalValue, selection[1].scale.y, selection[1].scale.z]) ) on spn_scaleY buttondown do spinnerStartScaleY = selection[1].scale.y on spn_scaleY changed val do undo off (selection[1].scale = [selection[1].scale.x, val / 100, selection[1].scale.z]) on spn_scaleY buttonup do ( local finalValue = selection[1].scale.y undo off (selection[1].scale = [selection[1].scale.x, spinnerStartScaleY, selection[1].scale.z]) undo "Object Properties - Scale Y" on (selection[1].scale = [selection[1].scale.x, finalValue, selection[1].scale.z]) ) on spn_scaleZ buttondown do spinnerStartScaleZ = selection[1].scale.z on spn_scaleZ changed val do undo off (selection[1].scale = [selection[1].scale.x, selection[1].scale.y, val / 100]) on spn_scaleZ buttonup do ( local finalValue = selection[1].scale.z undo off (selection[1].scale = [selection[1].scale.x, selection[1].scale.y, spinnerStartScaleZ]) undo "Object Properties - Scale Z" on (selection[1].scale = [selection[1].scale.x, selection[1].scale.y, finalValue]) ) on chk_hide changed state do updateobj "ishidden" state on chk_Freeze changed state do updateobj "isfrozen" state on btn_DpbyLayer pressed do ( -- "Mixed" to "Layer" to "Object" Case btn_DpbyLayer.caption of ( "Mixed": ( btn_DpbyLayer.caption = "By Layer" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.displaybylayer = true ) "By Layer": ( btn_DpbyLayer.caption = "By Object" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.displaybylayer = false ToggledisplayProps true ) "By Object": ( btn_DpbyLayer.caption = "By Layer" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.displaybylayer = true ToggledisplayProps false ) ) ) on chk_SeeThrough changed state do updateobj "xray" state on chk_boxmode changed state do updateobj "boxmode" state on chk_BackfaceCull changed state do updateobj "backfacecull" state on chk_EdgesOnly changed state do updateobj "alledges" (not state) on chk_VertexTicks changed state do updateobj "vertexticks" state on chk_Trajectory changed state do updateobj "showtrajectory" state on chk_IgnoreExtents changed state do updateobj "ignoreextents" state on chk_ShowFrozeninGray changed state do updateobj "ShowFrozeninGray" state on chk_NeverDegrade changed state do updateobj "neverdegrade" state on chk_VertexChannelDisplay changed state do updateobj "showvertexcolors" state on ddl_VertexDisplayMode selected sel do ( print sel local m = Case sel of ( 1: #color 2: #illum 3: #alpha 4: #color_plus_illum 5: #soft_select default: #color ) if sel != 4 then spn_mapchannel.enabled = false else spn_mapchannel.enabled = true with redraw off undo "Object Properties - Change Vertex Color Type" on for o in selection do o.vertexColorType = m ) on btn_Shaded changed val do updateobj "vertexColorsShaded" val on spn_mapchannel buttondown do spinnerStartMapChannel = selection[1].vertexColorMapChannel on spn_mapchannel changed val do undo off (for o in selection do o.vertexColorMapChannel = val) on spn_mapchannel buttonup do ( local finalValue = selection[1].vertexColorMapChannel undo off (for o in selection do o.vertexColorMapChannel = spinnerStartMapChannel) undo "Object Properties - Change Map Channel" on (for o in selection do o.vertexColorMapChannel = finalValue) ) on btn_RPbyLayer pressed do ( -- "Mixed" to "Layer" to "Object" Case btn_RpbyLayer.caption of ( "Mixed": ( btn_RpbyLayer.caption = "By Layer" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.renderbylayer = true ) "By Layer": ( btn_RpbyLayer.caption = "By Object" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.renderbylayer = false ToggleRenderProps true ) "By Object": ( btn_RpbyLayer.caption = "By Layer" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.renderbylayer = true ToggleRenderProps false ) ) ) on spn_Visibility buttondown do ( if selection[1][1].controller == undefined do selection[1].visibility = bezier_float() spinnerStartVisibility = selection[1].visibility.controller.value ) on spn_Visibility changed val do ( for o in selection where o[1].controller == undefined do o.visibility = bezier_float() with redraw off undo off (for o in selection do o.visibility.controller.value = val) ) on spn_Visibility buttonup do ( local finalValue = selection[1].visibility.controller.value undo off (for o in selection do o.visibility.controller.value = spinnerStartVisibility) undo "Object Properties - Change Visibility" on (for o in selection do o.visibility.controller.value = finalValue) ) on chk_renderable changed state do updateobj "renderable" state on chk_inherit changed state do updateobj "inheritvisibility" state on chk_PrimVis changed state do updateobj "primaryvisibility" state on chk_SecondVis changed state do updateobj "Secondaryvisibility" state on chk_ReceiveShadows changed state do updateobj "receiveShadows" state on chk_CastShadows changed state do updateobj "castshadows" state on chk_applyatmospherics changed state do updateobj "applyatmospherics" state on chk_RenderOccluded changed state do updateobj "renderoccluded" state on spn_gbuffer buttondown do spinnerStartGBuffer = selection[1].gbufferchannel on spn_gbuffer changed val do undo off (for o in selection do o.gbufferchannel = val) on spn_gbuffer buttonup do ( local finalValue = selection[1].gbufferchannel undo off (for o in selection do o.gbufferchannel = spinnerStartGBuffer) undo "Object Properties - Change G-Buffer" on (for o in selection do o.gbufferchannel = finalValue) ) on spn_MbMultiplier buttondown do spinnerStartMotionBlurMultiplier = selection[1].imageMotionBlurMultiplier on spn_MbMultiplier changed val do undo off (for o in selection do o.imageMotionBlurMultiplier = val) on spn_MbMultiplier buttonup do ( local finalValue = selection[1].imageMotionBlurMultiplier undo off (for o in selection do o.imageMotionBlurMultiplier = spinnerStartMotionBlurMultiplier) undo "Object Properties - Change Motion Blur Multiplier" on (for o in selection do o.imageMotionBlurMultiplier = finalValue) ) on btn_mbByLayer pressed do ( -- "Mixed" to "Layer" to "Object" Case btn_MbbyLayer.caption of ( "Mixed": ( btn_MbbyLayer.caption = "By Layer" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.motionbylayer = true ) "By Layer": ( btn_MbbyLayer.caption = "By Object" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.motionbylayer = false ToggleMBProps true ) "By Object": ( btn_MbbyLayer.caption = "By Layer" with redraw off undo "Object Properties - Change By Layer" on for o in selection do o.motionbylayer = true ToggleMBProps false ) ) ) on chk_MbEnabled changed state do updateobj "motionBlurOn" state on rdo_MbMode changed state do ( local m = Case state of ( 1: #none 2: #object 3: #image ) if state != 3 then spn_MbMultiplier.enabled = false else spn_mbMultiplier.enabled = true with redraw off undo "Object Properties - Motion Blur Mod" on for o in selection do o.motionBlur = m ) ) rollout RL_AdvLighting "Adv. Lighting" width:460 height:566 ( Group "Selection Information" ( edittext edt_numGeom "Num. Geometric Objects:" across:2 readonly:true edittext edt_NumLightobjects "Num Light Objects:" readonly:true ) label lbl_c "" label lbl_d "Geometric Object Radiosity Properties" label lbl_e "" checkbox chk_ExcludefromAdv "Exclude from Adv. Lighting Calculations" across:2 button btn_GIByLayer "By Object" Group "Adv.lighting General Properties" ( checkbox chk_Castshadows "Cast Shadows" checkbox chk_receiveshadows "Receive Shadows" spinner spn_NumRegathering "Num. Regathering Rays Multiplier:" ) Group "Radiosity-only Properties" ( checkbox chk_Diffuse "Diffuse (reflective && translucent)" checkbox chk_specular "Specular (Transparent)" checkbox chk_exclude "Exclude from Regathering" ) Group "Object Subdivison Properties" ( checkbox chk_useGlobal "Use Global Subdivision Settings" checkbox chk_Subdivide "Subdivide" offset:[20,0] checkbox chk_useAdaptive "User Adaptive Subdivision" offset:[40,0] ) Group "Mesh Settings" ( spinner spn_maxmeshsize "Max. Mesh Size" across:2 type:#worldunits range:[0,10000,0.01] spinner spn_ContrastThreshold "Contrast Threshold" range:[0,100,0.01] spinner spn_minmeshsize "Min. Mesh Size" across:2 type:#worldunits range:[0,10000,0.01] spinner spn_initialmeshsize "Initial Mesh Size" type:#worldunits range:[0.,10000,0.01] ) spinner spn_RadiosityRefine "Radiosity Refine Iterations:" type:#integer range:[0,65535,0] edittext edt_iterationsdone "Iterations Done" Readonly:true label lbl_a "" Group "Light Object Radiosity properties" ( checkbox chk_excludefromRadiosity "Exclude from Radiosity Processing" across:2 button btn_Lightbyobject "By Object" checkbox chk_storeDirect "Store Direct Illumination in Mesh" ) fn getprop thecontrol theProp theType = ( local theVal = getproperty selection[1] theProp local testVal = theVal for o in selection where superclassof o != light while testVal == theVal do ( if theval != (getproperty o theProp) then testVal = (getproperty o theProp) ) if testVal == theVal then ( Case thetype of ( 1: thecontrol.checked = theVal 2: thecontrol.value = theVal 3: thecontrol.text = theval as string ) ) else ( Case thetype of ( 1: thecontrol.tristate = 2 2: thecontrol.indeterminate = true 3: thecontrol.text = 0 ) ) ) fn UpdateAdvLighting = ( if selection.count != 0 then ( for o in RL_AdvLighting.controls do o.enabled = false if (for o in selection where superclassof o == Geometryclass collect o).count != 0 do ( for o in RL_AdvLighting.controls do o.enabled = true edt_numGeom.text = (for o in selection where superclassof o == Geometryclass collect o).count as string edt_NumLightObjects.text = (for o in selection where superclassof o == light collect o).count as string getprop chk_ExcludefromAdv "isGIExcluded" 1 --btn_GIByLayer GIByLayer getprop chk_Castshadows "isGIOccluder" 1 getprop chk_receiveshadows "isGIReceiver" 1 getprop spn_NumRegathering "GIRayMult" 2 getprop chk_Diffuse "isGIDiffuse" 1 getprop chk_specular "isGISpecular" 1 getprop chk_exclude "isGIExcludedFromRegather" 1 getprop chk_useGlobal "GIUseGlobalMeshing" 1 getprop chk_Subdivide "GIMeshingEnabled" 1 getprop chk_useAdaptive "GIUseAdaptiveSubdivision" 1 getprop spn_maxmeshsize "GIMeshSize" 2 getprop spn_ContrastThreshold "GIContrastThreshold" 2 getprop spn_minmeshsize "GIMinMeshSize" 2 getprop spn_initialmeshsize "GIInitialMeshSize" 2 getprop spn_RadiosityRefine "nbGIRefineSteps" 2 getprop edt_iterationsdone "nbGIRefineStepsDone" 3 --chk_excludefromRadiosity isGIExcluded --btn_Lightbyobject GIByLayer --chk_storeDirect "storeIllumToMesh" local same = true local value = (for o in selection where superclassof o == Geometryclass collect o)[1].GIByLayer for o in (for o in selection where superclassof o == Geometryclass collect o) while same do same = o.GIByLayer == value if not same then ( btn_GIByLayer.caption = "Mixed" --s = false for o in RL_AdvLighting.controls do o.enabled = false btn_GIByLayer.enabled = true ) else ( if value then ( --s = false btn_GIByLayer.caption = "By Layer" for o in RL_AdvLighting.controls do o.enabled = false btn_GIByLayer.enabled = true spn_RadiosityRefine.enabled = true ) else ( --s = true btn_GIByLayer.caption = "By Object" ) ) if chk_useGlobal.checked then ( chk_Subdivide.enabled = false chk_useAdaptive.enabled = false spn_maxmeshsize.enabled = false spn_ContrastThreshold.enabled = false spn_minmeshsize.enabled = false spn_initialmeshsize.enabled = false ) if chk_Subdivide.checked then ( chk_useAdaptive.enabled = false spn_maxmeshsize.enabled = false spn_ContrastThreshold.enabled = false spn_minmeshsize.enabled = false spn_initialmeshsize.enabled = false ) if chk_ExcludefromAdv.checked then ( for o in RL_AdvLighting.controls do o.enabled = false chk_ExcludefromAdv.enabled = true btn_GIByLayer.enabled = true spn_RadiosityRefine.enabled = true ) chk_excludefromRadiosity.enabled =false btn_Lightbyobject.enabled = false chk_storeDirect.enabled = false ) if (for o in selection where superclassof o == light collect o).count != 0 then ( --chk_excludefromRadiosity isGIExcluded --btn_Lightbyobject GIByLayer --chk_storeDirect "storeIllumToMesh" local same = true local value = (for o in selection where superclassof o == light collect o)[1].GIByLayer for o in (for o in selection where superclassof o == light collect o) while same do same = o.GIByLayer == value if not same then ( btn_Lightbyobject.caption = "Mixed" --s = false btn_Lightbyobject.enabled = true chk_excludefromRadiosity.enabled = false chk_storeDirect.enabled = false ) else ( if value then ( --s = false btn_Lightbyobject.caption = "By Layer" --for o in RL_AdvLighting.controls do o.enabled = false btn_Lightbyobject.enabled = true chk_excludefromRadiosity.enabled = false btn_Lightbyobject.enabled = true chk_storeDirect.enabled = false ) else ( --s = true btn_Lightbyobject.caption = "By Object" chk_excludefromRadiosity.enabled = true btn_Lightbyobject.enabled = true chk_storeDirect.enabled = true btn_Lightbyobject.enabled = true ) ) ) else ( --for o in RL_AdvLighting.controls do o.enabled = false ) ) else ( for o in RL_AdvLighting.controls do o.enabled = false ) ) fn Setprop theprop theval = ( with redraw off ( local s = ("Object Properties - " + theprop as string) undo "test" on for o in selection where superclassof o != light do setproperty o theprop theval ) ) on RL_AdvLighting open do ( UpdateAdvLighting() callbacks.addScript #selectionSetChanged "RL_AdvLighting.UpdateAdvLighting()" id:#DW_ObjProps callbacks.addScript #sceneUndo "RL_AdvLighting.UpdateAdvLighting()" id:#DW_ObjProps ) on RL_AdvLighting close do ( callbacks.removescripts #selectionsetchanged id:#DW_ObjProps callbacks.removescripts #sceneUndo id:#DW_ObjProps ) on btn_GIByLayer pressed do ( -- "Mixed" to "Layer" to "Object" Case btn_GIByLayer.caption of ( "Mixed": ( btn_GIByLayer.caption = "By Layer" with redraw off for o in selection do o.GIByLayer = true ) "By Layer": ( btn_GIByLayer.caption = "By Object" with redraw off for o in selection do o.GIByLayer = false --ToggledisplayProps true for o in RL_AdvLighting.controls do o.enabled = true ) "By Object": ( btn_GIByLayer.caption = "By Layer" with redraw off for o in selection do o.GIByLayer = true --ToggledisplayProps false for o in RL_AdvLighting.controls do o.enabled = false btn_GIByLayer.enabled = true ) ) ) on chk_ExcludefromAdv changed state do ( setProp "isGIExcluded" state for o in RL_AdvLighting.controls do o.enabled = not state chk_ExcludefromAdv.enabled = true btn_GIByLayer.enabled = state --spn_RadiosityRefine.enabled = state ) on chk_Castshadows changed state do setProp "isGIOccluder" state on chk_receiveshadows changed state do setProp "isGIReceiver" state on spn_NumRegathering changed val do setProp "GIRayMult" val on chk_Diffuse changed state do setProp "isGIDiffuse" state on chk_specular changed state do setProp "isGISpecular" state on chk_exclude changed state do setProp "isGIExcludedFromRegather" state on chk_useGlobal changed state do ( setProp "GIUseGlobalMeshing" state chk_Subdivide.enabled = not state chk_useAdaptive.enabled = not state spn_maxmeshsize.enabled = not state spn_ContrastThreshold.enabled = not state spn_minmeshsize.enabled = not state spn_initialmeshsize.enabled = not state ) on chk_Subdivide changed state do ( setProp "GIMeshingEnabled" state chk_useAdaptive.enabled = not state spn_maxmeshsize.enabled = not state spn_ContrastThreshold.enabled = not state spn_minmeshsize.enabled = not state spn_initialmeshsize.enabled = not state ) on chk_useAdaptive changed state do setProp "GIUseAdaptiveSubdivision" state on spn_maxmeshsize changed val do setProp "GIMeshSize" val on spn_ContrastThreshold changed val do setProp "GIContrastThreshold" val on spn_minmeshsize changed val do setProp "GIMinMeshSize" val on spn_initialmeshsize changed val do setProp "GIInitialMeshSize" val on spn_RadiosityRefine changed val do setprop "nbGIRefineSteps" val --on edt_iterationsdone on chk_excludefromRadiosity changed state do setProp "isGIExcluded" state on btn_Lightbyobject pressed do ( --with redraw off for o in selection where superclassof o == light do o.GIByLayer = state Case btn_Lightbyobject.caption of ( "Mixed": ( btn_Lightbyobject.caption = "By Layer" setProp "GIByLayer" true btn_Lightbyobject.enabled = true ) "By Layer": ( btn_Lightbyobject.caption = "By Object" setProp "GIByLayer" false --ToggledisplayProps true btn_Lightbyobject.enabled = true chk_excludefromRadiosity.enabled = true btn_Lightbyobject.enabled = true chk_storeDirect.enabled = true ) "By Object": ( btn_Lightbyobject.caption = "By Layer" setProp "GIByLayer" true --ToggledisplayProps false btn_Lightbyobject.enabled = true chk_excludefromRadiosity.enabled = false chk_storeDirect.enabled = false ) ) ) on chk_storeDirect changed state do setProp "storeIllumToMesh" state ) rollout RL_UserDef "User Defined" width:460 height:830 ( dotNetControl TB_Properties "System.Windows.Forms.Textbox" width:450 height:605 align:#center fn UpdateUserDef = ( if selection.count == 1 then ( TB_Properties.text = getuserPropBuffer selection[1] ) if selection.count > 1 then TB_Properties.text = "Multiple Objects Selected" if selection.count == 0 then TB_Properties.text = "" ) on RL_UserDef open do ( TB_Properties.Font = dotNetObject "System.Drawing.Font" "Courier" 8 ((dotNetClass "System.Drawing.FontStyle").Regular) TB_Properties.BorderStyle = (dotNetClass "System.Windows.Forms.BorderStyle").FixedSingle TB_Properties.BackColor = (dotNetClass "System.Drawing.Color").fromARGB (((colorMan.getColor #background) * 255)[1] as integer) (((colorMan.getColor #background) * 255)[2] as integer) (((colorMan.getColor #background) * 255)[3] as integer) TB_Properties.ForeColor = (dotNetClass "System.Drawing.Color").fromARGB (((colorMan.getColor #text) * 255)[1] as integer) (((colorMan.getColor #text) * 255)[2] as integer) (((colorMan.getColor #text) * 255)[3] as integer) TB_Properties.MultiLine = true TB_Properties.WordWrap = false TB_Properties.ScrollBars = (dotNetClass "System.Windows.Forms.ScrollBars").Both TB_Properties.AcceptsReturn = true TB_Properties.AcceptsTab = true UpdateUserDef() callbacks.addScript #selectionSetChanged "RL_UserDef.UpdateUserDef()" id:#DW_ObjProps ) on RL_Userdef close do ( callbacks.removescripts #selectionsetchanged id:#DW_ObjProps ) on TB_Properties lostfocus senderArg arg do ( setUserPropBuffer selection[1] TB_Properties.text ) on TB_Properties keyUp s e do ( if e.KeyCode == e.KeyCode.Enter do s.selectedtext = (dotNetClass "System.Environment").newline ) ) rollout RL_Vray "Vray Props." width:460 height:834 ( GroupBox grp1 "Matte Properties" pos:[255,7] width:188 height:320 checkbox chk_matteobjs "Matte Object" pos:[265,26] width:85 height:15 checkbox chk_SecondaryMatteenable "Matte for reflection/refraction" pos:[265,43] width:168 height:15 spinner spn_AlphaContr "Alpha Contribution " pos:[357,62] width:80 height:16 range:[-1,1,1] type:#float GroupBox grp2 "Direct Light" pos:[263,83] width:175 height:110 checkbox chk_Shadows "Shadows" pos:[274,101] width:68 height:15 checkbox chk_affectAlpha "Affect Alpha" pos:[274,120] width:82 height:15 colorPicker cp1 "Color " pos:[275,140] width:158 height:20 color:black spinner spn_brightness "Brightness " pos:[353,167] width:80 height:16 range:[0,1,1] type:#float GroupBox grp3 "Reflection/Refraction/GI" pos:[264,201] width:173 height:111 spinner spn_ReflAm "Reflection amount " pos:[353,222] width:80 height:16 range:[0,1,1] type:#float spinner spn_RefrAm "Refraction amount " pos:[353,245] width:80 height:16 range:[0,1,1] type:#float spinner spn_GIAm "GI amount " pos:[353,268] width:80 height:16 range:[0,1,1] type:#float checkbox chk_noGI "No GI on other mattes" pos:[274,290] width:122 height:15 GroupBox grp4 "Object Properties" pos:[11,5] width:232 height:585 GroupBox grp5 "Motion blur" pos:[21,25] width:212 height:140 checkbox chk_VRay_MoBlur_DefaultGeomSamples "Use default moblur samples" pos:[31,45] width:153 height:15 spinner spn_VRay_MoBlur_GeomSamples "Motion blur samples " pos:[126,65] width:96 height:16 range:[1,1000,1] type:#integer checkbox chk_VRay_MoBlur_DurationToggle "Moblur duration" pos:[31,85] width:122 height:15 across:2 spinner spn_VRay_MoBlur_Duration "" pos:[162,85] width:60 height:16 range:[0,1000,1] type:#float GroupBox grp6 "" pos:[31,105] width:192 height:2 checkbox chk_VRay_MoBlur_VelocityChannelToggle "Velocity channel" pos:[31,115] width:122 height:15 across:2 spinner spn_VRay_MoBlur_VelocityChannel "" pos:[162,115] width:60 height:16 range:[0,100,1] type:#integer spinner spn_VRay_MoBlur_VelocityChannelMult "Velocity chan. mult. " pos:[126,135] width:96 height:16 range:[0,1000,1] type:#float GroupBox grp7 "Global illumination" pos:[21,175] width:212 height:140 checkbox chk_VRay_GI_Generate "Generate GI" pos:[31,195] width:122 height:15 across:2 spinner spn_VRay_GI_GenerateMultipier "" pos:[162,195] width:60 height:16 range:[0,1000,1] type:#float checkbox chk_VRay_GI_Receive "Receive GI" pos:[31,215] width:122 height:15 across:2 spinner spn_VRay_GI_Multipier "" pos:[162,215] width:60 height:16 range:[0,1000,1] type:#float spinner spn_VRay_GI_SurfaceID "GI surface ID " pos:[126,235] width:96 height:16 range:[1,1000,1] type:#integer spinner spn_VRay_GI_RayTracedSSSID "Raytraced SSS ID " pos:[126,255] width:96 height:16 range:[0,1000,1] type:#integer GroupBox grp8 "" pos:[31,275] width:192 height:2 spinner spn_VRay_GI_SubdivsMultiplier "GI subdivs multiplier " pos:[126,285] width:96 height:16 range:[0,1000,1] type:#float GroupBox grp9 "Caustics" pos:[21,325] width:212 height:90 checkbox chk_VRay_Caustics_Generate "Generate caustics" pos:[31,345] width:110 height:15 checkbox chK_VRay_Caustics_Receive "Receive caustics" pos:[31,365] width:106 height:15 spinner spn_VRay_Caustics_Multipier "Caustics multiplier " pos:[126,385] width:96 height:16 range:[0,1000,1] type:#float GroupBox grp10 "Appearance" pos:[21,425] width:212 height:110 checkbox chk_VRay_GI_VisibleToReflections "Visible in reflection" pos:[31,445] width:111 height:15 checkbox chk_VRay_GI_VisibleToRefractions "Visible in refractions" pos:[31,465] width:117 height:15 checkbox chk_VRay_ToonOutlines "VRayToon outlines" pos:[31,485] width:117 height:15 checkbox chk_VRay_GenerateRenderElements "Generate render elements" pos:[31,505] width:117 height:15 dropdownList ddl_VRay_Mesh_Geometry "Geometry" pos:[27,545] width:135 height:40 items:#("Static", "Dynamic", "Default") fn parseMatteShadowColor colorText = ( local valueTexts = filterString colorText "[]," local values = for valueText in valueTexts collect (valueText as float) if values.count == 3 then color (values[1] * 255) (values[2] * 255) (values[3] * 255) else if values.count == 6 then ( local red = (valueTexts[1] as float) + (valueTexts[2] as float) / (10.0 ^ valueTexts[2].count) local green = (valueTexts[3] as float) + (valueTexts[4] as float) / (10.0 ^ valueTexts[4].count) local blue = (valueTexts[5] as float) + (valueTexts[6] as float) / (10.0 ^ valueTexts[6].count) color (red * 255) (green * 255) (blue * 255) ) else undefined ) fn formatMatteShadowColor theColor = ( local red = substituteString ((theColor.r / 255.0) as string) "." "," local green = substituteString ((theColor.g / 255.0) as string) "." "," local blue = substituteString ((theColor.b / 255.0) as string) "." "," "[" + red + "," + red + "," + green + "," + green + "," + blue + "," + blue + "]" ) fn getbufferprop thecontrol theProp UserProp = ( if (for o in selection where superclassof o == geometryclass collect o).count != 0 do ( local theVal = getUserProp (for o in selection where superclassof o == geometryclass collect o)[1] UserProp local testVal = theVal for o in selection where superclassof o == geometryclass while testVal == theVal do ( if theval != (getUserProp o UserProp) then testVal = (getuserProp o userProp) ) if theVal == undefined or testVal == undefined then ( Case theProp of ( "checked": thecontrol.checked = false "value": thecontrol.indeterminate = true "selection": thecontrol.selection = 0 ) ) else if testVal != theVal then ( Case theProp of ( "checked": setproperty thecontrol "tristate" 2 "value": setproperty thecontrol "indeterminate" true "selection": setproperty thecontrol "selection" 0 ) ) else ( local parsedVal = theVal if classof theVal == string do ( Case theProp of ( "checked": parsedVal = (toLower theVal == "true" or theVal == "1") "value": ( local normalizedVal = substituteString theVal "," "." try (parsedVal = normalizedVal as float) catch (parsedVal = 0.0) if parsedVal == undefined do parsedVal = 0.0 ) "selection": try (parsedVal = theVal as integer) catch (parsedVal = 0) ) ) if theProp == "selection" then parsedVal += 1 setproperty thecontrol theProp parsedVal ) ) ) fn setDefaultVrayProp theNode theProp theDefault = ( if getUserProp theNode theProp == undefined do setUserProp theNode theProp theDefault ) fn UpdateVrayProps = ( if selection.count != 0 then ( if (for o in selection where superclassof o == geometryclass collect o).count != 0 then ( for o in RL_Vray.controls do o.enabled = true for o in selection where superclassof o == geometryclass do ( setDefaultVrayProp o "VRay_MoBlur_GeomSamples" "2" setDefaultVrayProp o "VRay_MoBlur_Override" "False" setDefaultVrayProp o "VRay_MoBlur_Override_Duration" "1,000000" setDefaultVrayProp o "VRay_MoBlur_Velocity_Override" "False" setDefaultVrayProp o "VRay_MoBlur_Velocity_Channel" "1" setDefaultVrayProp o "VRay_MoBlur_Velocity_Multiplier" "1,000000" setDefaultVrayProp o "VRay_GI_Generate" "True" setDefaultVrayProp o "VRay_GI_Receive" "True" setDefaultVrayProp o "VRay_GI_Multipier" "1,000000" setDefaultVrayProp o "VRay_GI_GenerateMultipier" "1,000000" setDefaultVrayProp o "VRay_GI_SubdivsMultiplier" "1,000000" setDefaultVrayProp o "VRay_Caustics_Generate" "True" setDefaultVrayProp o "VRay_Caustics_Receive" "True" setDefaultVrayProp o "VRay_Caustics_Multipier" "1,000000" setDefaultVrayProp o "VRay_MoBlur_DefaultGeomSamples" "True" setDefaultVrayProp o "VRay_Matte_Enable" "False" setDefaultVrayProp o "VRay_Matte_Alpha" "1,000000" setDefaultVrayProp o "VRay_Matte_Shadows" "False" setDefaultVrayProp o "VRay_Matte_ShadowAlpha" "False" setDefaultVrayProp o "VRay_Matte_ShadowColor" "[0,0,0]" setDefaultVrayProp o "VRay_Matte_ShadowBrightness" "1,000000" setDefaultVrayProp o "VRay_Matte_ReflectionAmount" "1,000000" setDefaultVrayProp o "VRay_Matte_RefractionAmount" "1,000000" setDefaultVrayProp o "VRay_Matte_GIAmount" "1,000000" setDefaultVrayProp o "VRay_Matte_GI_OtherMattes" "True" setDefaultVrayProp o "VRay_GI_SurfaceID" "0" setDefaultVrayProp o "VRay_SSS_SurfaceID" "0" setDefaultVrayProp o "VRay_GI_VisibleToReflections" "True" setDefaultVrayProp o "VRay_GI_VisibleToRefractions" "True" setDefaultVrayProp o "VRay_Has_Toon_Outlines" "True" setDefaultVrayProp o "VRay_Generate_Render_Elements" "True" setDefaultVrayProp o "VRay_Mesh_Geometry" "2" setDefaultVrayProp o "VRay_Secondary_Matte_Enable" "false" ) RL_Vray.open = true ( getbufferprop chk_matteobjs "checked" "VRay_Matte_Enable" getbufferprop spn_AlphaContr "value" "VRay_Matte_Alpha" getbufferprop chk_SecondaryMatteenable "checked" "VRay_Secondary_Matte_Enable" getbufferprop chk_Shadows "checked" "VRay_Matte_Shadows" getbufferprop chk_affectAlpha "checked" "VRay_Matte_ShadowAlpha" local matteShadowColor = getuserprop (for o in selection where superclassof o == geometryclass collect o)[1] "VRay_Matte_ShadowColor" if matteShadowColor != undefined do ( try (cp1.color = parseMatteShadowColor matteShadowColor) catch() ) getbufferprop spn_brightness "value" "VRay_Matte_ShadowBrightness" getbufferprop spn_reflAm "value" "VRay_Matte_ReflectionAmount" getbufferprop spn_RefrAm "value" "VRay_Matte_RefractionAmount" getbufferprop spn_GIAm "value" "VRay_Matte_GIAmount" getbufferprop chk_noGI "checked" "VRay_Matte_GI_OtherMattes" getbufferprop spn_VRay_GI_SurfaceID "value" "VRay_GI_SurfaceID" getbufferprop chk_VRay_MoBlur_DefaultGeomSamples "checked" "VRay_MoBlur_DefaultGeomSamples" getbufferprop spn_VRay_MoBlur_GeomSamples "value" "VRay_MoBlur_GeomSamples" getbufferprop chk_VRay_MoBlur_DurationToggle "checked" "VRay_MoBlur_Override" getbufferprop spn_VRay_MoBlur_Duration "value" "VRay_MoBlur_Override_Duration" getbufferprop chk_VRay_MoBlur_VelocityChannelToggle "checked" "VRay_MoBlur_Velocity_Override" getbufferprop spn_VRay_MoBlur_VelocityChannel "value" "VRay_MoBlur_Velocity_Channel" getbufferprop spn_VRay_MoBlur_VelocityChannelMult "value" "VRay_MoBlur_Velocity_Multiplier" getbufferprop chk_VRay_GI_Generate "checked" "VRay_GI_Generate" getbufferprop spn_VRay_GI_GenerateMultipier "value" "VRay_GI_GenerateMultipier" getbufferprop chk_VRay_GI_Receive "checked" "VRay_GI_Receive" getbufferprop spn_VRay_GI_Multipier "value" "VRay_GI_Multipier" getbufferprop spn_VRay_GI_SubdivsMultiplier "value" "VRay_GI_SubdivsMultiplier" getbufferprop spn_VRay_GI_RayTracedSSSID "value" "VRay_SSS_SurfaceID" getbufferprop chk_VRay_Caustics_Generate "checked" "VRay_Caustics_Generate" getbufferprop chK_VRay_Caustics_Receive "checked" "VRay_Caustics_Receive" getbufferprop spn_VRay_Caustics_Multipier "value" "VRay_Caustics_Multipier" getbufferprop spn_VRay_GI_SurfaceID "value" "VRay_GI_SurfaceID" getbufferprop chk_VRay_GI_VisibleToReflections "checked" "VRay_GI_VisibleToReflections" getbufferprop chk_VRay_GI_VisibleToRefractions "checked" "VRay_GI_VisibleToRefractions" getbufferprop chk_VRay_ToonOutlines "checked" "VRay_Has_Toon_Outlines" getbufferprop chk_VRay_GenerateRenderElements "checked" "VRay_Generate_Render_Elements" getbufferprop ddl_VRay_Mesh_Geometry "selection" "VRay_Mesh_Geometry" ) ) else ( for o in RL_Vray.controls do o.enabled = false RL_Vray.open = false ) ) else for o in RL_Vray.controls do o.enabled = false ) fn setprop theprop theval = ( with redraw off ( --if VrayProps doesn't exist... --assign default values local s = ("Vray Props - " + theprop as string) local storedVal = if classof theval == float then substituteString (theval as string) "." "," else theval undo s on for o in selection do setUserProp o theprop storedVal ) ) on RL_Vray open do ( UpdateVrayProps() callbacks.addScript #selectionSetChanged "RL_Vray.UpdateVrayprops()" id:#DW_ObjProps ) on RL_Vray close do ( callbacks.removescripts #selectionsetchanged id:#DW_ObjProps ) on chk_matteobjs changed state do setprop "VRay_Matte_Enable" state on chk_SecondaryMatteenable changed state do setProp "VRay_Secondary_Matte_Enable" state on spn_AlphaContr changed val do setprop "VRay_Matte_Alpha" val on chk_Shadows changed state do setprop "VRay_Matte_Shadows" state on chk_affectAlpha changed state do setprop "VRay_Matte_ShadowAlpha" state on cp1 changed new_col do ( with redraw off ( undo "Vray Props - VRay_Matte_ShadowColor" on for o in selection do setUserProp o "VRay_Matte_ShadowColor" (formatMatteShadowColor new_col) ) ) on spn_brightness changed val do setprop "VRay_Matte_ShadowBrightness" val on spn_Reflam changed val do setprop "VRay_Matte_ReflectionAmount" val on spn_RefrAm changed val do setprop "VRay_Matte_RefractionAmount" val on spn_GIam changed val do setprop "VRay_Matte_GIAmount" val on chk_noGI changed state do setprop "VRay_Matte_GI_OtherMattes" state on spn_VRay_GI_SurfaceID changed val do setprop "VRay_GI_SurfaceID" val on chk_VRay_MoBlur_DefaultGeomSamples changed state do setprop "VRay_MoBlur_DefaultGeomSamples" state on spn_VRay_MoBlur_GeomSamples changed val do setprop "VRay_MoBlur_GeomSamples" val on chk_VRay_MoBlur_DurationToggle changed state do setprop "VRay_MoBlur_Override" state on spn_VRay_MoBlur_Duration changed val do setprop "VRay_MoBlur_Override_Duration" val on chk_VRay_MoBlur_VelocityChannelToggle changed state do setprop "VRay_MoBlur_Velocity_Override" state on spn_VRay_MoBlur_VelocityChannel changed val do setprop "VRay_MoBlur_Velocity_Channel" val on spn_VRay_MoBlur_VelocityChannelMult changed val do setprop "VRay_MoBlur_Velocity_Multiplier" val on chk_VRay_GI_Generate changed state do setprop "VRay_GI_Generate" state on spn_VRay_GI_GenerateMultipier changed val do setprop "VRay_GI_GenerateMultipier" val on chk_VRay_GI_Receive changed state do setprop "VRay_GI_Receive" state on spn_VRay_GI_Multipier changed val do setprop "VRay_GI_Multipier" val on spn_VRay_GI_SubdivsMultiplier changed val do setprop "VRay_GI_SubdivsMultiplier" val on spn_VRay_GI_RayTracedSSSID changed val do setprop "VRay_SSS_SurfaceID" val on chk_VRay_Caustics_Generate changed state do setprop "VRay_Caustics_Generate" state on chK_VRay_Caustics_Receive changed state do setprop "VRay_Caustics_Receive" state on spn_VRay_Caustics_Multipier changed val do setprop "VRay_Caustics_Multipier" val on spn_VRay_GI_SurfaceID changed val do setprop "VRay_GI_SurfaceID" val on chk_VRay_GI_VisibleToReflections changed state do setprop "VRay_GI_VisibleToReflections" state on chk_VRay_GI_VisibleToRefractions changed state do setprop "VRay_GI_VisibleToRefractions" state on chk_VRay_ToonOutlines changed state do setprop "VRay_Has_Toon_Outlines" state on chk_VRay_GenerateRenderElements changed state do setprop "VRay_Generate_Render_Elements" state on ddl_VRay_Mesh_Geometry selected sel do setprop "VRay_Mesh_Geometry" (sel - 1) ) rollout RL_VrayLightProps "Vray Light Properties" width:460 height:200 ( Group "Light Properties" ( checkbox chk_generatecaustics "Generate Caustics" spinner spn_CausticSubdivs "Caustic Subdivs:" type:#integer range:[1,100000,8] spinner spn_CausticMultiplier "Caustics multiplier:" range:[0,100000,8] checkbox chk_generatediffuse "Generate Diffuse:" spinner spn_diffusesubdivs "Diffuse Subdivs:" type:#integer range:[1,100000,8] spinner spn_diffusemultiplier "Diffuse Multiplier:" range:[0,100000,8] ) fn getbufferprop thecontrol theProp UserProp = ( local theVal = getUserProp (for o in selection where superclassof o == light collect o)[1] UserProp local testVal = theVal for o in selection where superclassof o == light while testVal == theVal do ( if theval != (getUserProp o UserProp) then testVal = (getuserProp o userProp) ) if theVal == undefined or testVal == undefined then ( Case theProp of ( "checked": thecontrol.checked = false "value": thecontrol.indeterminate = true "selection": thecontrol.selection = 0 ) ) else if testVal != theVal then ( Case theProp of ( "checked": setproperty thecontrol "tristate" 2 "value": setproperty thecontrol "indeterminate" true "selection": setproperty thecontrol "selection" 0 ) ) else ( local parsedVal = theVal if classof theVal == string do ( Case theProp of ( "checked": parsedVal = (toLower theVal == "true" or theVal == "1") "value": ( local normalizedVal = substituteString theVal "," "." try (parsedVal = normalizedVal as float) catch (parsedVal = 0.0) if parsedVal == undefined do parsedVal = 0.0 ) "selection": try (parsedVal = theVal as integer) catch (parsedVal = 0) ) ) if theProp == "selection" then parsedVal += 1 setproperty thecontrol theProp parsedVal ) ) fn setprop theprop theval = ( with redraw off ( --if VrayProps doesn't exist... --assign default values local s = ("VrayLight - " + theprop) local storedVal = if classof theval == float then substituteString (theval as string) "." "," else theval undo s on for o in selection do setUserProp o theprop storedVal ) ) fn UpdateVraylightProps = ( for o in selection where superclassof o == light and ( findstring (getUserPropBuffer o ) "VRay" )== undefined do ( setUserProp o "VRay_Caustics_Generate" "False" setUserProp o "VRay_Caustics_Multipier" "1,000000" setUserProp o "VRay_Caustics_Subdivs" "1500" setUserProp o "VRay_Diffuse_Generate" "True" setUserProp o "VRay_Diffuse_Multipier" "1,000000" setUserProp o "VRay_Diffuse_Subdivs" "150" ) if (for o in selection where superclassof o == light collect o).count != 0 then ( for o in RL_Vraylightprops.controls do o.enabled = true RL_Vraylightprops.open = true getbufferprop chk_generatecaustics "checked" "VRay_Caustics_Generate" getbufferprop spn_CausticSubdivs "value" "VRay_Caustics_Subdivs" getbufferprop spn_CausticMultiplier "value" "VRay_Caustics_Multipier" getbufferprop chk_generatediffuse "checked" "VRay_Diffuse_Generate" getbufferprop spn_diffusesubdivs "value" "VRay_Diffuse_Subdivs" getbufferprop spn_diffusemultiplier "value" "VRay_Diffuse_Multipier" ) else ( for o in RL_Vraylightprops.controls do o.enabled = false RL_Vraylightprops.open = false ) ) on RL_VRaylightprops open do ( UpdateVraylightProps() callbacks.addScript #selectionSetChanged "RL_VrayLightProps.UpdateVrayLightprops()" id:#DW_ObjProps ) on RL_VrayLightprops close do ( callbacks.removescripts #selectionsetchanged id:#DW_ObjProps ) on chk_generatecaustics changed state do setprop "VRay_Caustics_Generate" state on spn_CausticSubdivs changed val do setprop "VRay_Caustics_Subdivs" val on spn_CausticMultiplier changed val do setprop "VRay_Caustics_Multipier" val on chk_generatediffuse changed state do setprop "VRay_Diffuse_Generate" state on spn_diffusesubdivs changed val do setprop "VRay_Diffuse_Subdivs" val on spn_diffusemultiplier changed val do setprop "VRay_Diffuse_Multipier" val ) rollout RL_maxscript "Maxscript Info" width:460 height:830 ( --edittext edt_class "Class:" --edittext edt_superclass "SuperClass:" --edittext edt_Properties "ShowProperties:" dotNetControl TB_Properties "System.Windows.Forms.Textbox" width:450 height:580 align:#center edittext edt_search "Find:" width:380 across:2 button btn_search "Find" pos:[395, 590] width:50 height:20 fn printMatprops themat = ( DWOBjsMatString = stringstream "" ss = stringstream "" format "Material Name: %\r\n" themat to:ss format "Material Class: %\r\n" (classof themat) to:ss format "SuperClass: %\r\n" (superclassof themat) to:ss for p in getPropNames themat do ( format "% : % : value: %\r\n" ("." + (p as string)) (classof (getproperty themat p)) (getproperty themat p) to:ss ) format "\r\n" to:ss format (ss as string) to:DWOBjsMatString ) fn gSubMaps map root = ( if map != undefined then ( printmatprops map for i in 1 to getNumSubTexmaps map do gSubMaps (getSubTexmap map i) root ) ) fn gSubMatsMaps mat = ( if mat != undefined do ( for i in 1 to getNumSubMtls mat do gSubMatsMaps (getSubMtl mat i) for i in 1 to getNumSubTexmaps mat do gSubMaps (getSubTexmap mat i) mat ) ) fn UpdateMXS = ( if selection.count == 1 then ( --edt_class.text = (classof selection[1]) as string --edt_superclass.text = (superclassof selection[1]) as string local s = stringstream "" format "Name: %\r\n" selection[1].name to:s format "Classof: %\r\n" (classof selection[1]) to:s format "SuperClassof: %\r\n" (superclassof selection[1]) to:s format "\r\n\r\nObject Properties\r\n\r\n" to:s for p in getPropNames selection[1] do ( try(format "% : % : value: %\r\n" ("." + (p as string)) (classof (getproperty selection[1] p)) (getproperty selection[1] p) to:s)catch() ) ss = stringstream "" sss = "" format "\r\n\r\n--Object Interfaces\r\n\r\n" to:s showinterfaces selection[1] to:ss seek ss 0 while not eof ss do ( append sss ((Readline ss) + "\r\n") ) format sss to:s format "\r\n\r\n--General Node Properties\r\n\r\n" to:s for p in getPropNames node do ( try(format "% : % : value: %\r\n" ("." + (p as string)) (classof (getproperty selection[1] p)) (getproperty selection[1] p) to:s)catch() ) ss = stringstream "" sss = "" format "\r\n\r\n--Node Interfaces\r\n\r\n" to:s showinterfaces node to:ss seek ss 0 while not eof ss do ( append sss ((Readline ss) + "\r\n") ) format sss to:s format "\r\n\r\n--Modifier Properties\r\n\r\n" to:s for o in selection[1].modifiers do ( format "Modifier Name: %\r\n" o.name to:s format "Modifier Class: %\r\n" (classof o) to:s format "SuperClassof: %\r\n" (superclassof o) to:s for p in getPropNames o do ( format "% : % : value: %\r\n" ("." + (p as string)) (classof (getproperty o p)) (getproperty o p) to:s ) format "\r\n\r\n" to:s ) format "\r\n\r\n--Material Properties\r\n\r\n" to:s if selection[1].material != undefined then ( gSubMatsMaps selection[1].material format (DWOBjsMatString as string) to:s ) --print s TB_Properties.text = s ) if selection.count > 1 then TB_Properties.text = "Multiple Objects Selected" if selection.count == 0 then TB_Properties.text = "" ) on RL_maxscript open do ( TB_Properties.Font = dotNetObject "System.Drawing.Font" "Courier" 8 ((dotNetClass "System.Drawing.FontStyle").Regular) TB_Properties.BorderStyle = (dotNetClass "System.Windows.Forms.BorderStyle").FixedSingle TB_Properties.BackColor = (dotNetClass "System.Drawing.Color").fromARGB (((colorMan.getColor #background) * 255)[1] as integer) (((colorMan.getColor #background) * 255)[2] as integer) (((colorMan.getColor #background) * 255)[3] as integer) TB_Properties.ForeColor = (dotNetClass "System.Drawing.Color").fromARGB (((colorMan.getColor #text) * 255)[1] as integer) (((colorMan.getColor #text) * 255)[2] as integer) (((colorMan.getColor #text) * 255)[3] as integer) TB_Properties.MultiLine = true TB_Properties.WordWrap = false TB_Properties.ScrollBars = (dotNetClass "System.Windows.Forms.ScrollBars").Both TB_Properties.AcceptsReturn = true TB_Properties.HideSelection = false UpdateMXS() callbacks.addScript #selectionSetChanged "RL_maxscript.UpdateMXS()" id:#DW_ObjProps ) on btn_search pressed do ( newstring = (substring TB_Properties.text (TB_Properties.SelectionStart + 1 + TB_Properties.selectionLength) -1) searchPosition = findstring newstring edt_search.text if searchPosition != undefined then ( TB_Properties.SelectionStart = TB_Properties.SelectionStart + TB_Properties.SelectionLength + searchPosition - 1 TB_Properties.SelectionLength = edt_search.text.count TB_Properties.ScrollToCaret() ) ) on RL_Maxscript close do ( callbacks.removescripts #selectionsetchanged id:#DW_ObjProps ) ) rollout DL_ObjsProp DWObjPropsVersion width:480 height:720 ( checkbutton btn_General "General" width:80 height:30 across:5 checkbutton btn_AdvLighting "Adv. Lighting" width:80 height:30 checkbutton btn_userdef "User Defined" width:80 height:30 checkbutton btn_VRay "VRay" width:80 height:30 checkbutton btn_maxscript "Maxscript" width:80 height:30 subrollout sub_main width:460 height:640 button btn_refresh "Refresh" height:30 width:100 pos:[265,685] button btn_close "Close" height:30 width:100 pos:[370,685] fn clearSub = ( try(removeSubRollout sub_Main RL_ObjsProp)catch() try(removeSubRollout sub_Main RL_AdvLighting)catch() try(removeSubRollout sub_Main RL_UserDef)catch() try(removeSubRollout sub_Main RL_Vray)catch() try(removeSubRollout sub_Main RL_VrayLightProps)catch() try(removeSubRollout sub_Main RL_Maxscript)catch() ) on DL_objsProp open do ( Case ::DWObjPropsTab of ( 1: ( addsubrollout sub_main RL_ObjsProp btn_General.checked = true ) 2: ( addsubrollout sub_main RL_AdvLighting btn_AdvLighting.checked = true ) 3: ( addsubrollout sub_main RL_UserDef btn_userdef.checked = true ) 4: ( addsubrollout sub_main RL_Vray btn_Vray.checked = true addsubrollout sub_main RL_VRayLightProps ) 5: ( addsubrollout sub_main RL_Maxscript btn_maxscript.checked =true ) ) ) on DL_objsProp close do ( DW_ObjPropsPos = getdialogpos DL_objsProp ) on btn_General changed state do ( Clearsub() addsubrollout sub_main RL_ObjsProp btn_AdvLighting.checked = false btn_userdef.checked = false btn_Vray.checked = false btn_maxscript.checked = false ::DWObjPropsTab = 1 ) on btn_AdvLighting changed state do ( Clearsub() addsubrollout sub_main RL_Advlighting ::DWObjPropsTab = 2 btn_General.checked = false --btn_AdvLighting.checked = false btn_userdef.checked = false btn_Vray.checked = false btn_maxscript.checked = false ) on btn_UserDef changed state do ( Clearsub() addsubrollout sub_main RL_UserDef ::DWObjPropsTab = 3 btn_General.checked = false btn_AdvLighting.checked = false --btn_userdef.checked = false btn_Vray.checked = false btn_maxscript.checked = false ) on btn_Vray changed state do ( ClearSub() addsubrollout sub_main RL_VRay addsubrollout sub_main RL_VRayLightProps ::DWObjPropsTab = 4 btn_General.checked = false btn_AdvLighting.checked = false btn_userdef.checked = false --btn_Vray.checked = false btn_maxscript.checked = false ) on btn_Maxscript changed state do ( Clearsub() addsubrollout sub_main RL_maxscript ::DWObjPropsTab = 5 btn_General.checked = false btn_AdvLighting.checked = false btn_userdef.checked = false btn_Vray.checked = false --btn_maxscript.checked false ) on btn_refresh pressed do ( case ::DWObjPropsTab of ( 1: RL_ObjsProp.UpdateSel() 2: RL_AdvLighting.UpdateAdvLighting() 3: RL_UserDef.UpdateUserDef() 4: ( RL_Vray.UpdateVrayProps() RL_VrayLightProps.UpdateVrayLightProps() ) 5: RL_maxscript.UpdateMXS() ) ) on btn_close pressed do ( Destroydialog DL_ObjsProp ) ) Createdialog DL_ObjsProp style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox) pos:DW_ObjPropsPos )