r/Maxscript • • Oct 18 '16

Using Notepad++

2 Upvotes

Is there a recommended way to configure Notepad++ for writing MAXScript?
I browsed this page http://www.ycdivfx.com/notepad-maxscript-ycdivfx-packages/ and noticed that this would execute scripts directly from the Notepad++ - I don't know if this is something that I want to do - is it??
I think I just wanted some colourised terms and mayyybe an autocomplete, anyone know what I'm after or what is a good standard?


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 • • Aug 02 '16

Is it possible to populate the modifier stack in a rollout?

2 Upvotes

Hey guys, Maxscript newbie here,

I have a small toolset that I'm creating, the goal is make this toolset all I would need in max, so that I can unify my art workflow. I'm currently struggling to find an easy way to populate the current selections modifiers in a listbox. Any ideas?


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

Set spline interpolation to a given amount for all selected splines?

2 Upvotes

Hi,

I've been doing work with hundreds of splines, initially bringing them in as .AI files.
The default "interpolation" level is always 6, and I want to set ALL the spline interpolation levels to 2 (or 3).

When googling for this, I came across this for something called a "Spline shape." I have never converted anything to a "spline shape" only an "editable spline" in my workflow. A little confused about it.

I looked up the command here. <splineshape>.steps Integer default: 6

Just not sure how to integrate it into the script itself so that it applies to all selected.

Bonus question: when I go into MAXScript Listener, it doesn't record my interpolation change, still not sure what makes it pick up certain changes and not others. Anyone know why it doesn't record changes to spline interpolation?


r/Maxscript • • Feb 22 '16

How can we add a Batch Render job into Max's Batch Render Dialog?

2 Upvotes

Hi everyone,

I was wondering if there is any way to add cameras (render jobs) into max's default 'Batch Render' dialog with max script?

Seeing the render jobs in max's default interface would make the script more reliable to other users.

Thanks in advance !!


r/Maxscript • • Aug 23 '15

[request] animated generation

2 Upvotes

I am really new to this, but I need some help on making a script.

The script should:

  1. make copies of selected object,

  2. align them in specific matter(min to max in my situation),

  3. rotate it at specific angle on some axis(z)

  4. link to parent.

Another solution can be, generating a number of copies instantly, and then make edits to visibility, so that each child becomes visible one frame after parent does that.


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 • • Apr 27 '15

How to test whether a shape is CW or CCW?

2 Upvotes

Currently I outline the shape and compare the size before and after and follow with an if/else for the 2 outcomes, it works but I don't think it's an optimal way to test for this sort of thing. Does anyone know a better way to MAXScript this? Cheers.


r/Maxscript • • Apr 14 '15

Diving deeper into the Material Editor to 'ShowInViewport'

2 Upvotes
meditMaterials[2].materialList[28].ShowInViewport = true  
This works, but the bitmap I really want to show is a little deeper  
  
Toggling the Use Real-World Scale I get this:  
meditMaterials[2].materialList[28][#Maps][#Diffuse_Color__Map__166____Falloff].map2.coords.realWorldScale = on  
But I'm unable to reach a 'ShowInViewport' at this level.  
meditMaterials[2].materialList[28][#Maps][#Diffuse_Color__Map__166____Falloff].map2.ShowInViewport  
gives:  
-- Unknown property: "showInViewport" in Map #167:Bitmap  
  
Can I get this Bitmap showing in my viewport with Maxscript?  

It works to press the 'Show Shaded Material in Viewport' button, but I'm wanting to script a bunch of these to turn on when importing a library material for a building texture tool.


r/Maxscript • • Apr 05 '15

Could someone point out how to optimize/foolproof this simple working script.

2 Upvotes
(
    ( 
        if MatEditor.isOpen() == true then
        (
            MatEditor.Close()
        )
        else
        (
        )
    )
    meditMaterials[1] = Standardmaterial ()
    meditMaterials[1].Diffuse = color 255 255 255
    meditMaterials[1].ambient = color 255 255 255
    meditMaterials[1].name = "whiteMaterial"
    (
        objectSelection = selection as array
        clearSelection()
        for obj in objectSelection do
        (
            select obj
            currentObject = $
            if superclassof $ == GeometryClass then
            (
                $.material = meditMaterials[1]
                $.wirecolor = color 0 0 0
                meditMaterials[1] = $.material
            )
            else
            (
            )
        )
    select objectSelection
    )
)

This here just applies a white material and sets wireframes to black.
In a past thread someone had gone through and dropped a few lines from a different script for me:
-- select obj
-- currentObject = $
(keep the obj instead of $)
I tried that here but it was failing, I must have missed something.
And I just saw these two lines:
$.material = meditMaterials[1]
meditMaterials[1] = $.material
I feel like a moron for leaving those in, ha.
I have empty else statements, is this a correct use of that?
Thanks again.
edit: Is 'foolproof' the correct term?


r/Maxscript • • Nov 14 '14

Invert Vertex Colors

2 Upvotes

Script can be found here MAXScript Adventures: Invert Vertex Colors

Function: Inverts the values of the user selected channel Color, Illum, Alpha. Still needs some love, but works good on meshes /w solid vert color values.

Would appreciate any crits or feedback/suggestions! Thanks.


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 • • May 21 '14

[Request]Rotational alignment of one object to another using eulers?

2 Upvotes

Hi there. I'm in need of some assistance with this and haven't found a good source of help in what I'm hoping to do.

What I want to do is create a script where I can align one object's rotation in all three axis to another object. I tried accessing the rotational transform but that's in quaternion and not euler rotations... And trying to tell it to just apply the quaternion rotational information doesn't produce results.

Care to help me out here? I'll be in your debt if you can.

Thank you!


r/Maxscript • • May 03 '14

Create morph targets for every frame?

2 Upvotes

Self-confessed Maxscript newb here <-- I'm more of an artist looking for a solution to a problem, I don't expect people to do it for me but I need a little help being pointed in the right direction after spending hours looking for a solution and not being able to find anything.

Basically I'm looking for a way to create a morph target from the current state of the selected object for every frame on the timeline (up to 100 frames because of morpher 100 channels limitation) then key frame each of those morph targets per frame so I can essentially 'play back' a complex mesh deformation (like a cloth sim for example) as a morph target animation.

The reason for this is that I do a lot of work with game engines (ue4, cryengine etc..) that don't necessarily support vertex animation but do support morph target animation and so this is kind of a sneaky/hacky method to get complex vertex animations into these game engines using morph targets.

I can confirm this method works, basically I go to frame 1, Capture Current State, move to the next frame/next morph channel, Capture Current State again etc... Then for the keyframing I go back to frame 1, set channel 1 to 100, then go to frame 2, set channel 1 to 0, set channel 2 to 100 etc... I've tried this and it does work in the game engines, however it's incredibly tedious to setup as you can imagine.

In my research so far I know that "for i = 1 to 100 do (" is basically what I need to do these operations and the key framing aspect of my idea seems basic enough and I can probably figure that out on my own...

The area that I'm having trouble with is activating the 'Capture Current State' button in the morpher modifier using maxscript or performing the equivalent operation/function. In my research I've realized that there are certain buttons/functions within modifiers that the macrorecorder doesn't see and this happens to be one of them.

Can anyone point me in the direction of making this possible? Is it even possible to do this or am I stuck doing it manually?

Thanks in advance!


r/Maxscript • • May 03 '14

[Wip] Delete Empty Layers

2 Upvotes

Please help me format scripts correctly and paste them into Reddit
(What is a fast way to put 4 spaces before every line?)
This script I've been using was originally written by Bernardo Amorim in 2008.
It deletes any empty layers, except, if you happen to have an empty layer ticked, which is too often in my experience.
I want to add something to the beginning to select the "0(default)" layer - so never will an empty layer be selected before the operation begins. I've tried to find how to do that, but have failed Here it is:

emptyLayers =#()
for i = 0 to layerManager.count-1 do
(
	ilayer = layerManager.getLayer i
	layerName = ilayer.name 
	layer = ILayerManager.getLayerObject i
	layerNodes = refs.dependents layer
---format "Layer: %; nodes: %\n" layerName layerNodes	
	layer.Nodes &theNodesTemp
	if theNodesTemp.count == 0  do
        (
	----print "empty layer"
	append emptyLayers (layerName as string)
---  print layerName
	)
)
format "vazias: % \n" emptylayers
for i = 1 to emptyLayers.count do
(
layermanager.deleteLayerByName emptyLayers[i]
)
if
LayerManager.isDialogOpen() ==true then (LayerManager.closeDialog();layermanager.editlayerbyname "")
else(
layermanager.editlayerbyname ""
)

edit: formatting.


r/Maxscript • • Mar 16 '14

[Script] Random Extrude

2 Upvotes

After using Greeble I found that it made things difficult to UV unwrap due to it creating hundreds of seperate objects, it also created overlapping faces on adjacent extrudes.

That's when I started making this script, it extrudes without creating overlapping faces and keeps the model as 1 object. There is also a greeble option after you have done the extrudes, it's kind of primitive and I've found there is a flaw in that part.

ctrl+f 'flaw' in the script to see the comment. The greeble option can create a bevel effect by mistake.

Easy way to test/see what the script does, is make a cube with many faces, say 6x6x6 & then select all faces.

Now activate the script and click extrude, which gives you a borg cube. Now click greeble and will add some face insets+extrudes. Will create bevels on some sides of the cube though. Was initially developed/tested on a flat plane where it works fine without the bevel flaw.

S button tries to adjust the extrude values to the scale of the model. Only works after you've done an extrude.

Clicking extrude multiple times cancels the current extrude and reapplies, acting as a new random seed. Keep clicking to try out new results.


As is common for me I finished this script then never actually used it, some time after that I realised the purpose of Greeble was not to UV it at all, so the premise for creating this script was flawed.

Still, the random extrude does give clean topology so it may be of use for something.

Download


r/Maxscript • • Mar 15 '14

[Script] Evenly spread out objects on XYZ

2 Upvotes

Modification of one of Mikes scripts 'Adjust Spread'

Example scenario: select 10 objects and move them to the same position in space, now activate the script and move the sliders. the objects will spread out on the axis you choose. Used for quickly spacing objects interactively.

macroScript AdjustSpreadXYZ category:"_GRS Scripts" ButtonText:"Spread XYZ" tooltip:"Adjust Spread XYZ"
(
centerpos = selection.center
objarray = getcurrentselection()
objpositionsX = #()
for obj in objarray do (append objpositionsX (obj.pos.x))
objpositionsY = #()
for obj in objarray do (append objpositionsY (obj.pos.y))
objpositionsZ = #()
for obj in objarray do (append objpositionsZ (obj.pos.z))

rollout Spreader "Spreader" width:110 height:96
(
	spinner spn_spreadX "Spread X" pos:[10,11] width:90 height:16 range:[-100,100,0] scale:0.1
	spinner spn_spreadY "Spread Y" pos:[10,41] width:90 height:16 range:[-100,100,0] scale:0.1	
	spinner spn_spreadZ "Spread Z" pos:[10,71] width:90 height:16 range:[-100,100,0] scale:0.1	
	
	on spn_spreadX changed amt do 
	(
		for i = 1 to objarray.count do
		(objarray[i].pos.x = objpositionsX[i] +(amt* (i*3.0)))
	)
	
	on spn_spreadY changed amt do 
	(
		for i = 1 to objarray.count do
		(objarray[i].pos.y = objpositionsY[i] +(amt* (i*3.0)))
	)
	
	on spn_spreadZ changed amt do 
	(
		for i = 1 to objarray.count do
		(objarray[i].pos.z = objpositionsZ[i] +(amt* (i*3.0)))
	)
)
createDialog Spreader dlg_Spreader
)

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] Apply Checker Texture

2 Upvotes
macroScript ApplyChecker category:"_GRS Scripts" ButtonText:"Apply Checker" tooltip:"Apply Checker"
(
	chk = Checker()
	chk.color1=color 0 39 150
	chk.color2=color 0 0 99
	chk.coords.realWorldScale = off
	chk.coords.U_Tiling = 6
	chk.coords.V_Tiling = 6
	$.material = standard diffuseMap:(chk) showInViewport:true
	$.wirecolor = color 0 108 225
)

Tweak colour values to your liking


r/Maxscript • • 3d ago

I built a free, open-source tool to fix missing textures in 3ds Max (Corona & V-Ray)

Post image
1 Upvotes

r/Maxscript • • Oct 01 '26

TexBakeFree

1 Upvotes

This script allows you to transfer baked data from a high-poly model to a low-poly model. It was created as a free alternative to another paid script.

Installation: Move `TexBakeFree.ms` to `\Program Files\Autodesk\3ds Max 20XX\scripts`

In 3ds Max: Scripting > Run Script > Select `TexBakeFree.ms`

Usage:

Pick Source – the model to take the texture from

Pick Target – the model to transfer the texture to

Clear – reset selected models

Bake maps – select the map type

UV channel – select the channel

Padding px – extent of the bleed beyond UV borders

Ray offset – ray projection depth (auto)

Auto UV – automatic UV unwrapping (disabled by default)

Assign new material to Target – automatically apply the texture to the new model

Flat lighting – uniform texture lighting

Map size – texture resolution (256 to 8K)

Format – texture format

Bake – perform the bake

The finished texture will appear at `C:\Users\your_username\Documents\3ds Max 20XX\sceneassets\images\TexBake\`, and the folder will open automatically.

Tested on 3ds Max 2024 and works without issues. Issues with texture lighting occur in 3ds Max 2012.

The script is free to distribute and modify. It would be appreciated if you kept the original author's nickname included in the file.

Download: https://sharemods.com/ptrbdjjs2bm5/TexBakeFree.ms.html


r/Maxscript • • Jul 29 '26

Quiero automatizar export d5a en 3ds max 2025 ¿como podria hacer esto?

1 Upvotes

INICIO ↓ ¿Hay objeto seleccionado? NO → mensaje error SI ↓ Capturar nombre objeto ↓ Pulsar botón D5 Export ↓ Esperar ventana D5 ↓ Pulsar Export ↓ Esperar ventana Guardar Como ↓ Escribir nombre objeto.d5a ↓ Pulsar Save ↓ Confirmar exportación FIN

Conseguí automatizar 2 de ellos, pero cuando quiero que "choose file" se ponga un nombre no lo logro. ¿alguien puede ayudarme?

ESTO ES LO QUE LLEVO HASTA AHORA.
clearListener()

(

dotNet.loadAssembly "UIAutomationClient"

-- Abrir ventana D5

actionMan.executeAction 886054871 "19"

sleep 1

-- Obtener ventana

local h = windows.getChildHWND 0 "D5 Sync(Export .D5A)"

local AE = dotNetClass "System.Windows.Automation.AutomationElement"

local ptr = dotNetObject "System.IntPtr" h[1]

local win = AE.FromHandle ptr

-- Buscar botón Export

local cond = dotNetObject "System.Windows.Automation.PropertyCondition" AE.NameProperty "Export"

local scope = (dotNetClass "System.Windows.Automation.TreeScope").Descendants

local btn = win.FindFirst scope cond

if btn == undefined then

(

messageBox "No encontré el botón Export"

)

else

(

format "Botón encontrado: %\n" btn.Current.Name

local InvokePattern = dotNetClass "System.Windows.Automation.InvokePattern"

local pattern = btn.GetCurrentPattern InvokePattern.Pattern

pattern.Invoke()

format "Export pulsado.\n"

)

)


r/Maxscript • • Mar 11 '26

Bake to texture Vray, Apply color mapping and denoise

1 Upvotes

Hello everyone,

I am trying to make a script that will add Vray bake elements to selected objects. I managed to do that. But there are options for the bake elements specifically [] Apply color mapping and [] Denoise. What is the property ID or How can I find the property ID to turn these on or off?

Thanks.


r/Maxscript • • Jul 16 '25

Max script error

1 Upvotes

Hello everyone.

I'm trying to load a .ski (.bon) file into 3dsmax and I have a script for this particular format but for some odd reason I can't upload the file into max because I get this error. Does anyone know how to fix this issue?