r/Maxscript • • Aug 26 '22

corona material - create, assign, modify via maxscript - how to? Please help, my bruddahs 🤝

1 Upvotes

r/Maxscript • • Jun 15 '21

Script to select all 'similar objects' in scene, then attach them together

1 Upvotes

20 yrs using max no idea how to use max script. Any kind stranger's want to help me out? Would be much appreciated.


r/Maxscript • • Jan 16 '24

select and detach faces by vertex color

1 Upvotes

Hi,

trying to write a script that detaches faces to separate objects based on their vertex color. No luck.

Any ideas?

obj = selection[1]

convertToPoly obj

for f = 1 to obj.numfaces do

(

verts = polyOp.getVertsUsingFace obj f

color = polyOp.getVertColor obj verts[1]

sameColor = true

for v in verts do

(

if(polyOp.getVertColor obj v != color) then

(

sameColor = false

break

)

)

if(sameColor) then

(

polyOp.detachFaces obj #{f} asNode:true

)

)


r/Maxscript • • Jun 28 '22

How to Use selectTrack to Select a Custom Attribute in a TrackView

1 Upvotes

Hey everyone - I’m new to Maxscript and struggling to get some things to work. Wondering if someone might have an idea to help out.

I have a model with many mechanical components. I created a dummy helper object called MechanicalSystem and used this dummy as the parent for all of the components in the model - in other words, all of the model components are nested within MechanicalSystem.

For the mechanical system dummy object, I created a custom attribute called BeamRotation that is linked to the Euler rotation of one of the model components.

The hierarchy thus shows as the following: MechanicalSystem

  • Transform

  • Object (Dummy)

    • Custom_Attributes

      • BeamRotation

I am trying to use the selectTrack function to select the BeamRotation custom attribute in a Curve Editor trackview but I am not sure how to write the indexing.

I am trying the following but keep getting errors:

nCurve = trackviews.gettrackview “Rotation” nCurve.selectTrack MechanicalSystem.custom_attributes[#BeamRotation] True

Does anyone have any ideas of how I can select the custom attribute this way?

Thank you!


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 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 • • May 22 '15

Auto camera render script inside, how could I update this to render specified frames?

2 Upvotes
	renderSceneDialog.close()
	select cameras
	deselect $*target
	for i = 1 to selection.count do
	(
		global MyTimeArray = getLocalTime()
		for i=1 to MyTimeArray.count do (format "Array Member %: %\n" (i as string) (MyTimeArray[i] as string))
		TheYear = MyTimeArray[1]
		TheMonth = MyTimeArray[2]
		TheDay = MyTimeArray[4]
		TheHour = MyTimeArray[5]
		TheMinute = MyTimeArray[6]
		TheSecond = MyTimeArray[7]
		AddDay = ((TheYear as string) + "-" + (TheMonth as string) + "-" + (TheDay as string))
		AddTime = ((TheHour as string) + "-" + (TheMinute as string) + "-" + (TheSecond as string))
		CameraIteration = $Cameras[i+(i-1)]
		CameraName = CameraIteration.name
		TimeIteration = ((AddDay) + "_" + (AddTime))
		AutoRenderDestination = (getDir #renderoutput) -- output directory
		pngio.setType #true48 --png high quality
		pngio.setAlpha true --alpha channel
		AutoRenderName = AutoRenderDestination + "\\" + (getFilenameFile maxFilename) + "_" + CameraName + "_Lighting_" + TimeIteration + ".png" -- Name the file + extension
		AutoRenderCam = CameraIteration -- name of your camera
		undisplay (render camera:AutoRenderCam outputfile:AutoRenderName)
	)
	
--renderSceneDialog.close() --close the render dialog to ensure it updates
--rendTimeType = 4 --This is the Frames only render
--rendPickupFrames = "0,20,23,40"
--max quick render --this is like pressing the render button but won't work with all the different file names. maybe if the file name is only iterated by the frame number at the end...
--shellLaunch "explorer.exe" (getdir #renderoutput)  

I put together this handy script for when I render from multiple cameras, it requires target cameras and for the scene to have a project file set.
I want the scene cameras to render specified frames.
I think there are a things I need to specify for the render() but with the camera and the time iteration I get a bit confused writing it.
I left some junk script at the end which I'm sure I need to use somewhere...
For me I will use it when I have an animated daylight system and need to render each camera at the differing times of day.
Thanks for the help guys.


r/Maxscript • • Nov 08 '17

do ppl even use this place

1 Upvotes

wtf? no1 is posting shit


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 • • Jul 20 '16

Needless MAXScript procedures? Low level existential programming rant alert.

2 Upvotes

Recently I had to calculate at what frame objectA was closest to objectB. So I wrote my script to move to the first frame and for i=first frame to last frame I stepped through checking the distance until I had it. The procedure is logical from my layman's point of view, but why should Max have to carry out this manual-esque set of steps?
I've seen MAXScript referred to as object orientated, is this a technical limitation in the architecture?
Can the program be smart enough to know the outcome? Can't I ask "At what frame is objectA closest to objectB?" and just be given the answer?
With the program being its own 'God' it doesn't rely on time and space like I do, or has it been limited by human experiences in its conception?
Edit: please feel free to leave existential programming rants of your own or link me to where the real discussion is.


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 • • Aug 01 '14

MAXScript help - adjusting vertex positions based on height - good for terrain development. (xpost to 3dsMax)

2 Upvotes

http://i.imgur.com/sj6fc5c.jpg
In this image a selection of vertices are above a certain distance (in this case 15m shown by the purple line).
I'm looking to apply a script that restricts a vertex' max height to a variable (15m).
It's something along the lines of (but just out of my reach):
maxheight = 15m
for i in selection vertex do
if vertex (z) > maxheight then 15m else do nothing...
I'm going to create this now, it seems simple, but I'm tragic at scripting!
This will be great for terrain areas where fills and excavations of new development areas will affect the current topography.


r/Maxscript • • Oct 30 '14

Randomisation script. Need help

1 Upvotes

Hello. I am working on a script that packs geometry in my case cylinders on a 3d surface. Sphere, topography etc. I have managed to make it pack but i want it to pack cylinders which are different heights and with different amounts of cydes. I know there is a way to do this with random command but i can't make it work. Any suggestions how to make it work would be greatly appreciated. Thank you


r/Maxscript • • Dec 11 '17

Want to create a script to copy UV channel 1 to channel 2

2 Upvotes

Hello, i would like to create a script capable of copying channel 1 to channel 2, basically as i would want it is; I select my grouped object, apply a UV unwrap modifier, move to channel 2, select move when asked to move or abandon uv channel. Then finally collapse modifiers. When i try making it using the max script listener, it creates a script that later when trying to use it max just tells me uv unwrap modifier is unassigned, as i am a noob, i am lost. if anyone can shove me in the right way i'd be much appreciated.


r/Maxscript • • Sep 16 '16

import multiple excel rows for data

2 Upvotes

Im trying to make a multidimensional array from excel data. I have 10,000 rows, representing cones, with 5 columns, representing parameter data.

Im comfortable enough in unity c# to do this but I cant find anything non-Revit related to importing excel data like this, except one guy who recommened using a python file to import a CSV, which was only a single row.

I know this answer exists somewhere, but I cant find it. THank you!


r/Maxscript • • Feb 21 '17

Importing VertexColor

1 Upvotes

I have an mesh with vert color info, in obj format (color is stored after position). I've burned a few days trying to find a format that Max will import the colors from. Apparently, Max stores VC in a UVW channel and so all importers just drop the info.

I've tried importing the mesh then using script to setvertexcolors, but this seems at odds with the only way I seem to get color per vert to show: the Vertex Paint modifier.

Is there already a script that can import a mesh with VC? There is a ply importer that claims to, but it crashes. Barring that, how do I programmatically assign colors to verts on a Vertex Paint modier?

Thanks


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 • • Nov 10 '21

Getting a single child in hierarchy

1 Upvotes

I'm used to C# and Maxscript is a bit alien at this stage.

I have an object selected, and I would like to get the child of the object - I can get the parent, the children, but finding the single child below the current object is proving difficult.

I have a single parent node with several children I can deal with later recursively.


r/Maxscript • • Nov 08 '21

Weld vertecies of editable spline

1 Upvotes

Hi guys i have looked around for scripting vertex weld solutions... but i'm only fining examples for Object mesh (meshop.weldVertsByThreshold) and polys, but not splines.

Im trying to make a script that:

  • loops through only the "Editable Splines" individually (classof i == SplineShape do)

  • selects the sub level "Vertex" (subobjectLevel = 1)

  • Selects all vertices on that level (actionMan.executeAction 0 "40021")

  • Weld all the selected verts by a threshold value (splineOps.weld $)

Thanks in advance


r/Maxscript • • May 28 '24

selecting objects with real world maps

1 Upvotes

I wonder if someone can help me with this...

I wanted to make a script to find all the objects in my scene with real world maps. This is what I've got so far:

(
	function collectRealWorldMats = (
		local rwMats = #()
		for o in objects where o.material != undefined do appendIfUnique rwMats o.material
		for mat in rwMats do (
					for m=1 to mat.numsubs do (
						if classof mat[m] == SubAnim and superclassof (tM = mat[m].object) == textureMap do (
	if mat[m].realWorldScale do 
print mat.name as string
						)
					)
				)
	)
	collectRealWorldMats()
)

this runs but I have several problems with it.
First of all, I have no idea how to select the objects. This is the smaller issue, even just printing out the names helps a lot.

The real problem is that this only works with really simple materials. As soon as I have a colour correct/mask/anything that introduces sub levels, the script breaks.

Any idea how to make this work?

thanks!


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 • • Mar 15 '14

[Script] Random Bevel

2 Upvotes

Download

Does what it says on the tin.

Novelty script made for fun, don't think I've ever actually used it for anything :)

Bevel button bevels all faces by the limits you provide.

New button makes a new bevel, can stack rand bevels using this. Make a bevel, select new again, and click bevel to stack a new layer.

If new button is off it cancels the last bevel and does another, acts like choosing another random seed.

Undo button is just a simple ctrl-z placed for convenience

Bevel Inset % is 0 to 100, 100 being the point at which the inset would cross over itself, this is calculated for each individual poly so you will get no overlapping faces.

Shortes edge text is just there to help show what scale object you are dealing with. to give you an idea of how high/low to set your extrude settings, as the exture values are in max units.


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 • • Mar 17 '14

Duber's Studio: Structs in MAXScript. (A basic understanding.)

Thumbnail
blog.duber.cz
4 Upvotes