r/Maxscript • • May 24 '15

Help please, to optimize this script.(batch vray material realworldscale)

3 Upvotes

Hi!

I know that It's possible to reduce this mess of code, to two simple lines, but I simply don't have the knowledge.

This script toggle's on or off the realworld scale and sets the values for it. I would like to make it selection based, but I couldn't change the getclassinstances into a selection.

I also want it to check all the map slots for bitmaptexture, initially I tried to call the vray class into the for statement but that was beyond my grasp, so I then tried putting the vray class names into an array and adding to the getclassinstances, but isntead of course it didn't work so I copied and pasted it 16 times!! lol

Any help is appreciated.

if no help, maybe someone could use this code.

<code> if vraywindowrollout != undefined do destroyDialog vraywindowrollout try destroyDialog vraywindowrollout catch() (

rollout vraywindowrollout " Make windows" width:162 height:173
(
	
	
	Group "" (
	label lbl "Make a selection and go" align:#left
	checkbox RW_checkbox "Turn on Realworld Scale?" align:#left  checked:true
	spinner RW_width "Width" align:#left enabled:true range:[-1200,1200,120] type:#worldunits fieldwidth:40
	spinner RW_height "Height" align:#left enabled:true range:[-1200,1200,120] type:#worldunits fieldwidth:40
	button run_script "GO GO GO!" toolTip:"Press this button to GO." align:#center
	)	--end group
	
	--for statement needed here for selection?
	--for o in selection where (o.material!=undefined) collect o.material
	on run_script pressed do
	(
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_diffuse != undefined and classof o.texmap_diffuse == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_diffuse.coords.realWorldScale = RW_checkbox.state	
			o.texmap_diffuse.coords.realWorldWidth = RW_width.value	
			o.texmap_diffuse.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_reflection != undefined and classof o.texmap_reflection == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_reflection.coords.realWorldScale = RW_checkbox.state	
			o.texmap_reflection.coords.realWorldWidth = RW_width.value	
			o.texmap_reflection.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_refraction != undefined and classof o.texmap_refraction == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_refraction.coords.realWorldScale = RW_checkbox.state	
			o.texmap_refraction.coords.realWorldWidth = RW_width.value	
			o.texmap_refraction.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_bump != undefined and classof o.texmap_bump == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_bump.coords.realWorldScale = RW_checkbox.state	
			o.texmap_bump.coords.realWorldWidth = RW_width.value	
			o.texmap_bump.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_reflectionGlossiness != undefined and classof o.texmap_reflectionGlossiness == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_reflectionGlossiness.coords.realWorldScale = RW_checkbox.state	
			o.texmap_reflectionGlossiness.coords.realWorldWidth = RW_width.value	
			o.texmap_reflectionGlossiness.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_refractionGlossiness != undefined and classof o.texmap_refractionGlossiness == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_refractionGlossiness.coords.realWorldScale = RW_checkbox.state	
			o.texmap_refractionGlossiness.coords.realWorldWidth = RW_width.value	
			o.texmap_refractionGlossiness.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_refractionIOR != undefined and classof o.texmap_refractionIOR == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_refractionIOR.coords.realWorldScale = RW_checkbox.state	
			o.texmap_refractionIOR.coords.realWorldWidth = RW_width.value	
			o.texmap_refractionIOR.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_displacement != undefined and classof o.texmap_displacement == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_displacement.coords.realWorldScale = RW_checkbox.state	
			o.texmap_displacement.coords.realWorldWidth = RW_width.value	
			o.texmap_displacement.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_translucent != undefined and classof o.texmap_translucent == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_translucent.coords.realWorldScale = RW_checkbox.state	
			o.texmap_translucent.coords.realWorldWidth = RW_width.value	
			o.texmap_translucent.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_environment != undefined and classof o.texmap_environment == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_environment.coords.realWorldScale = RW_checkbox.state	
			o.texmap_environment.coords.realWorldWidth = RW_width.value	
			o.texmap_environment.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_hilightGlossiness != undefined and classof o.texmap_hilightGlossiness == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_hilightGlossiness.coords.realWorldScale = RW_checkbox.state	
			o.texmap_hilightGlossiness.coords.realWorldWidth = RW_width.value	
			o.texmap_hilightGlossiness.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_reflectionIOR != undefined and classof o.texmap_reflectionIOR == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_reflectionIOR.coords.realWorldScale = RW_checkbox.state	
			o.texmap_reflectionIOR.coords.realWorldWidth = RW_width.value	
			o.texmap_reflectionIOR.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_opacity != undefined and classof o.texmap_opacity == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_opacity.coords.realWorldScale = RW_checkbox.state	
			o.texmap_opacity.coords.realWorldWidth = RW_width.value	
			o.texmap_opacity.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_roughness != undefined and classof o.texmap_roughness == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_roughness.coords.realWorldScale = RW_checkbox.state	
			o.texmap_roughness.coords.realWorldWidth = RW_width.value	
			o.texmap_roughness.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_anisotropy != undefined and classof o.texmap_anisotropy == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_anisotropy.coords.realWorldScale = RW_checkbox.state	
			o.texmap_anisotropy.coords.realWorldWidth = RW_width.value	
			o.texmap_anisotropy.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--string $TEXarray[16] = {".texmap_diffuse", ".texmap_reflection", ".texmap_refraction", ".texmap_bump", ".texmap_reflectionGlossiness", ".texmap_refractionGlossiness", ".texmap_refractionIOR", ".texmap_displacement", ".texmap_translucent", ".texmap_environment", ".texmap_hilightGlossiness", ".texmap_reflectionIOR", ".texmap_opacity", ".texmap_roughness", ".texmap_anisotropy", ".texmap_anisotropy_rotation"}
	for o in getclassinstances VRayMtl where o.texmap_anisotropy_rotation != undefined and classof o.texmap_anisotropy_rotation == bitmaptexture do				---get all vraymtl w texmap_diffuse
		(
			o.texmap_anisotropy_rotation.coords.realWorldScale = RW_checkbox.state	
			o.texmap_anisotropy_rotation.coords.realWorldWidth = RW_width.value	
			o.texmap_anisotropy_rotation.coords.realWorldHeight = RW_height.value	
		)--end for
		
		
	--)--end Do
) --end Do run_script
	
)--end rollout

)--end if createdialog vraywindowrollout width:190 height:185 --pos:[1150, 175] </code>


r/Maxscript • • May 12 '15

Ships coordinates to animation keys

3 Upvotes

I am looking for someone who can make a script that reads historical position data (lon/lat/date&time) and translates this to animation keys / spline / etc.. on a spherical earth model.

The positional data comes in a .csv file.

I will need an estimate of time and cost.


r/Maxscript • • May 07 '15

"Are you sure?" prompt window

3 Upvotes

Similar to when you reset Max, can I use the simple messagebox to add an 'Are you sure?' prompt before executing a button's command?


r/Maxscript • • Apr 22 '15

[script]Getting the full track "path" from the trackview.pickTrackDlg

3 Upvotes

I'm trying to do a tool where the user at some point has to pick a controller track (for the link to link to something else) but the trackview.pickTrackDlg doesn't give me back useful info.

What I'd like to get is something like this:

"$Point002.pos.controller.Zero_Pos_XYZ.X_Position"

but with the trackview.pickTrackDlg() function my option seem's to be limited to those:

.name --giving me something like "X Position"
.anim --giving me something like Controller:Bezier_Float
.client --giving me something like Controller:Position_XYZ
.subNum --giving me something like 1
.client[<>.subNum] --giving me something like SubAnim:X_Position

The function itslef give me this result:

TrackViewPick:"X Position"

I have google for answer and I've look at the help file but I can't seem to find a way to have the whole identity, all the way up to the node.

If you have a way to allow the user of a script to select a track from the track view dialog and get the result from the node, help would be greatly appreciated.

Thank you.


r/Maxscript • • Apr 22 '15

Maxscript possibility for BASIC programmer/hacker

3 Upvotes

Hi, I'm currently in the middle of a project and I've made a little script to help me make windows(rectangular). Essentially I made a rollout and some if statements to extrude some poly. I start with a lot of individual polys (planes) and I use mat IDs to extrude and bevel my way from a flat plane to a simple window.

What I want to do is add an option for a brick arch above or a window sill below. Thinking if a loft/sweep object. So before I make my windows I would like a script to select the top edge and bottom edge and make a spline and sweep it, perhaps a FFD box to extend it past the limits of the original poly verts. The problem I have is when I record a script, it records the edges selects by number, and the numbers are all different for all the different polys' edges.

At this point I am thinking that I need to start making arrays and storing objects and looping for each face and doing comparisons? Which I might have been able to do AGES ago but atm not so much, so does anyone know if there's an easy way to select 'top and bottom' edges on a poly for each rectangular poly?


r/Maxscript • • Mar 26 '15

MAXScripting multiple iterations of buttons optimally?

3 Upvotes
 on btn1 pressed do
 (
 objectSelection = selection as array
 clearSelection()
 for obj in objectSelection do
 (
 	select obj
 	currentObject = $
 	$.modifiers[#ID].materialID =1
 	)
 	select objectSelection
 )

For the above sample I press button 1 and apply material 1 to an object (or multiple objects.)
If I need to do this for 30 buttons, 1 = 1, 2 = 2 etc, how do I do this without typing it all out?
Is that a function?
I'm still learning MAXScript.


r/Maxscript • • Mar 06 '15

Print a string without quotation marks?

3 Upvotes

What can I place after this to display a string without quotation marks?
Similar to Adding 'as name', but that'll return: #no quotes

myString = "no quotes"
myString

r/Maxscript • • Aug 13 '14

[Script] Set blueprints

3 Upvotes

Whenever I set up blueprints for a new model, I change a bunch of object properties and put them on a special layer. This script automates all of that. The creation of the UI was mainly to help me learn maxscript.

/*
Andrew McWhae 2014

Converts current selection to blueprints
- puts objects on layer called "_Blueprints" by default (this is editable)
- sets renderable to False
- sets frozen in gray to False
- if material is applied, sets self-illunimation to True

*/

macroScript SetBP category:"Drew" tooltip:"Useful for setting blueprints" ( fn SetAsBP layername renderable showgray layerfrozen sil = ( if (selection.count > 0) then ( layerBP = layermanager.newLayerFromName layername SI = False

	for obj in (selection as array) do
	(
		layerBP.addNode obj
		obj.renderable = renderable
		obj.showFrozenInGray = showgray
		
		if (obj.material != undefined) then
		(
			obj.material.selfIllumAmount = sil
			SI = True
		)
	)
	
	if (SI == False) then messageBox "No maps to apply self illumination to." title:"No maps found"

	clearSelection()
	layerBP.isfrozen = layerfrozen
)
else messageBox "No objects are selected" title:"Nothing selected"

)

rollout blueprints "Set blueprints" ( -- ui elements label info1 "Select objects to set as blueprints" group "Options" ( checkbox renderable "Renderable" checked:False checkbox grayfrozen "Show frozen in gray" checked:False checkbox freezelayer "Freeze layer" checked:True spinner selfillum "Self illumination: " range:[0,100,100] type:#integer ) edittext layerName "Layer name: " text:"_Blueprints" Button setBP "Set"

-- event handlers
on setBP pressed do
	SetAsBP layerName.text renderable.checked grayfrozen.checked freezelayer.checked selfillum.value

)

createDialog blueprints width:200 )

macros.run "Drew" "SetBP"


r/Maxscript • • Apr 08 '14

[Script] Create Point-chain

3 Upvotes

So, this is a script I've been working on (it's not what I'd consider "finished" but it's rare if I'm ever totally satisfied enough to sign-off on something like this for personal use.)

It's use was made to be included in a struct that's holding other tools that other scripts use but the function is called like any function in Maxscript by calling it by name and telling it how many points in the chain you want. I use this as the starting framework for my autorigger script but I can see it's usefulness in other areas. It's just about making a quick visualization tool for placement of bones for the autorigger and it has a global array declared in there for the purposes of passing the created points back to the script that called it.

Usual disclaimer applies, use at your own risk. This was created by me by reverse engineering some scripts that I found on Paul Neale's site (the "Custom shapes for rigging" one.) However, given that there's a significant amount of adjustment and changes, it's safe to say that this is more my own effort than his. Still, credit where it's due so huge shout-out goes to him for providing the base with which to figure this one out.

 fn ctPointChain pointTotal = --WORK IN PROGRESS
 (
      global pts = #()
      tool makePoints numPoints:9
      (
           local ptActive
           local total = pointTotal
           local viewPorts=#
           (
                #view_persp_user,
                #view_iso_user,
                #view_camera,
                #view_spot
           )
           on mousePoint clickNum do
           (
                if clickNum == 1 do
                (
                     p = point size:10.0 centermarker:true axistripod:false cross:false box:true constantscreensize:true drawontop:false wirecolor:green
                     append pts p
                     pts[1].pos = worldPoint
                     ptActive = pts[1]
                )
                if clickNum >= 2 and clickNum <= total do 
                (
                     p = point size:10.0 wirecolor:green
                     append pts p
                     ptActive = pts[clickNum]
                     lookAtCon=lookAt_Constraint()
                     pts[clickNum-1].rotation.controller=lookAtCon
                     lookAtCon.appendTarget pts[clickNum] 100
                     lookAtCon.lookAt_vector_length=100
                     lookAtCon.viewline_length_abs = false
                )
                if clickNum > total do
                (
                     --On the last step here, Make all points share the instanced object's base object.
                     select pts
                     $.baseobject = pts[1].baseobject
                     #stop
                )
           )
           on mouseMove moveIt do
           (
                ptActive.pos = worldPoint
           )
           on mouseAbort del do
           (
                select pts
                delete $
                pts=#()
           )
      )
      startTool makePoints
 ), --End Point Chain

r/Maxscript • • Mar 15 '14

[Script] Spline Bridge

3 Upvotes

Another novelty one I've never used.

Select 2 faces and this will make a spline connecting them with an arcing trajectory, you can then use that spline for whatever you want. I don't remember the intention when I made this, might of been just for the challenge/fun.

Later I found Super poly bridge script which also makes a spline and does many other goodies. the spline needs positioning in that though as it just creates a straight line.

This hasn't been rigorously tested and there are probably a few ways to break it, also the initial arc of the splines are at a fixed scale, so if your object is huge the arc will be weaker so the spline might look like a straight line. If your object is small then the arc might be extremely steep.

So tweaking could be needed, that is if you ever find a use for it.

Download


r/Maxscript • • Mar 15 '14

[Script] Make Planar Dialog

3 Upvotes

Download

Instruction manual

Initially made because I was to lazy to keep going in the right panels to find and click the tiny buttons, later added the quick planar ring functionality because aligning multiple lines always annoyed me.

I'm sure there must be a simple built in way to do this already, let me know if you found out how. (I mean aligning multiple lines in 1 step, not 5 like in my image)

undo button is just a simple ctrl-z put there for convenience if I got the planar direction wrong.


r/Maxscript • • Mar 15 '14

[Script] Toggle display of texture maps in viewport

3 Upvotes
macroScript ShowMaps category:"_GRS Scripts" ButtonText:"Toggle Maps" tooltip:"Toggle Maps"
(	
	disp = NitrousGraphicsManager.GetActiveViewportSetting()

	if disp.UseTextureEnabled==true then (
		--actionMan.executeAction 0 "63544" --shaded without
		actionMan.executeAction 0 "63546" --realistic without
		--actionMan.executeAction 0 "63510" --unknown but disables too
		disp.UseTextureEnabled = false
	)
	else (
		actionMan.executeAction 0 "63547" --realistic w maps
		--actionMan.executeAction 0 "63545" --shaded w maps
		disp.UseTextureEnabled = true	
	)
)

r/Maxscript • • Mar 15 '14

Mikes Script Pack (not made by me)

Thumbnail
mixescript.blogspot.co.uk
3 Upvotes

r/Maxscript • • Mar 15 '14

Quick Render custom size example

3 Upvotes

render outputSize: [1000,800]

Max help for more arguments

Doesn't seem to work with V-Ray


r/Maxscript • • Mar 15 '14

[Script] Remove Material

3 Upvotes
macroScript RemoveMaterial category:"_GRS Scripts" ButtonText:"Remove Material" tooltip:"Remove Material"
(
if $ !=undefined then (
	--$.mat = null
	Mat=standard()
	Mat.name = "mat_clean"
	$.wirecolor = color 3 3 3
	$.material = Mat
)

)

r/Maxscript • • Jun 06 '26

Hi everyone, somebody know how to create a 3ds max script that assigns selected materials to objects with the same name?

2 Upvotes

r/Maxscript • • Oct 23 '24

What’s the best platform to hire a freelance maxscript developer?

2 Upvotes

What the title says. I need a relatively complex (I think) script quicker than my learning curve allows. Who’m I gonna call?


r/Maxscript • • Sep 27 '24

How to get the count of currently selected edges in the viewport?

2 Upvotes

Hi all, I want to return the number of currently selected edges within the editable/edit poly modifier, how can I do this?

I tried (polyop.getEdgeSelection $).count but it just returns the count of all edges in the current object, not the ones selected.

Many thanks for your help.


r/Maxscript • • Aug 14 '23

Urgent! how to make instances unique Maxscript?

2 Upvotes

I need to make all the instances in an array unique, how can i do that?


r/Maxscript • • May 04 '22

Maxscript: Using the $ sign!

Thumbnail
youtu.be
2 Upvotes

r/Maxscript • • Mar 01 '22

How can I make simple modification to this script

2 Upvotes

This is a script that puts a ColorCorrection on every map, but just want it to be applied to the Diffuse map.
Thank you.

fn AddColorCorrection m =
(
	if isKindOf m VRayMtl then 
	(
		for p in getPropNames m where isKindOf (tex = getProperty m p) textureMap do
		(
			if not isKindOf tex Color_Correction do setproperty m p (Color_Correction name:("CC" + trimleft p #texmap) map:tex)
		)
	)

)
for o in selection where (mat = o.material) != undefined do AddColorCorrection mat

r/Maxscript • • Nov 09 '21

Maxscript offer - small code

2 Upvotes

Looking for some help on fixing my code or paying someone to write a small code for me.

Serious inquiries only please.


r/Maxscript • • Jul 17 '21

ID Finder script

2 Upvotes

With this script you can Find what kind of object and material IDs you have in your scene.

Download ID Finder

You can give random IDs and you can delete some of them .

Wish you a nice day 😊


r/Maxscript • • Apr 16 '21

Being annoyed by ones lack of consistency

2 Upvotes

--Saw this yesterday, 3 arrays created slightly differently one after the other. Do you like a full stop here.
myArr1 = #()
myArr2= #()
myArr3 =#()
--
usuallyLikeThis = ""
Then why did I name this $RenderCamera ?
--
if (this == that) then
(
do this
)else --that's an ugly place to put this?
(
do that
)

I've been trying to look at being more consistent in how I'm formatting code, the more I focus on that, the more I have these moments of self loathing when I'm acting like there aren't any rules, or making up new conventions on the fly.

I started writing my variable names out longer and using less abbreviations so it's camera instead of cam. But I'm sometimes wondering: 'what's the point!?'

I'm loving it but how do I become more disciplined?


r/Maxscript • • Mar 30 '21

Disable Buttons

2 Upvotes

Is it possible to use maxscript to deactivate previously active buttons when no object is selected?

	on bt_head changed state do
	(
		if bt_head.checked == true then
		(
			selectmore $Farlee_pelvis_torso_spine1_Ctrl
		)
		else if bt_head.checked == false then
		(
			deselect $Farlee_pelvis_torso_spine1_Ctrl
		)
		
	)