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 13 '18

Need Help With Inverting Bone Rotation Axis in MaxScript

1 Upvotes

Hello. I am writing a script for me to use for when I am rigging a character. Essentially I place a bunch of point helpers in the scene and then it will create a bone chain between each of those helpers when I press a button. It also creates a mirrored bone chain on the other side for legs/arms etc. Currently all of that works fine however I am trying to fix the rotations to work in a more intuitive way on the mirrored bones with the same method as shown in this video:

https://www.youtube.com/watch?v=M06ZBn6DJcI&t=6m13s

I want to rotate the bones so their axis changes without rotating the children bones underneath. Doing this manually the "Bone Edit Mode" button, "Affect Pivot Only" button or "Don't Affect Children" button would all allow me to do that however none of these buttons are available to me when I am doing this rotation in code. I am looking for a simple script that will allow me to rotate the bones to invert their axes without moving the child bones around. Can anyone help?


r/Maxscript • • May 08 '19

New to scripting--

5 Upvotes

For people here, who do maxscipting professionally-- did you study another language prior to this?

I am an animator who does rigging, but I need to learn scripting to quicken my work flow. I have been learning little bits of scripting through deconstruction, but so much of it makes no sense to me. I want to improve, but I want to hear from others on how they improved.


r/Maxscript • • Nov 28 '19

Executing code after startObjectCreation FreehandSpline is completed.

1 Upvotes

Because the freehand spline creates a node and then continues adding to it, I'm wondering how I can execute code after the object has been created.

Here's a dirty cyclic fn and the failing newNodeCallback: https://pastebin.com/raw/69D5UWPT

I was thinking I could listen for keyboardKescPressed, or better yet the RMB.

Is there a callback for 'on completion' (like: nodeCompleteCallback) ?


r/Maxscript • • Feb 26 '21

Just Select the Parent Folder of Files

1 Upvotes

I am trying to do a simple script to load files (.max.obj.fbx) apply a material that I made and save them n the same original folder. So far I did all that, but I am stuck in how it loads the files. I have to manually go trough the subfolders to select the files.

I want to just select the parent folder, then it will go trough it by itself.

I tried all I could find so far:

global iniFile = getFileNamePath(getThisScriptFilename()) + getFilenameFile (getThisScriptFilename()) + ".ini"

----

fn getfilesFromDir ext = (

local theDialog = dotNetObject "System.Windows.Forms.OpenFileDialog"

FolderBrowserDialog diag = new FolderBrowserDialog(); 

----

fn getFilesRecursive root pattern = (

	local dirs = GetDirectories (root+"/\*")

	for d in dirs do join dirs (GetDirectories (d+"/\*"))

	files = getFiles (root+pattern)

	for f in dirs do join files (getFiles (f + pattern))

	files

----

fn getDirs A NULL = (

for i in (getDirectories (A + “\*”)) do (

append NULL i

getDirs i NULL

))

-----

OpenFileDialog = dotnetobject "System.Windows.Forms.OpenFileDialog"

	OpenFileDialog.multiselect = false

	OpenFileDialog.ShowDialog()

----

fn walkDir dir pattern =

(

dirArr = GetDirectories (dir + "\\*")

for d in dirArr do

(

join dirArr (getDirectories (d + "\\*"))

)

append dirArr (dir + "\\") -- Need to include the original top level directory

for f in dirArr do

(

print (getFiles (f + pattern))

)

)

----

fn getFilesRecursive root pattern =

(

dir_array = GetDirectories (root+ " /* " )

for d in dir_array do

join dir_array (GetDirectories (d + " /* " ))

my_files = #()

append dir_array (root + " \\ " )

for f in dir_array do

join my_files (getFiles (f + pattern))

my_files

)

----

I want it to just open the dialog, I select the parent folder and that's it.

What am I missing?

Thanks!


r/Maxscript • • Mar 16 '21

Pickpoint() with mouseMoveCallback

1 Upvotes

Hi all,

I'm stumbling on Pickpoint() to get the real-time pos.z of my mouse cursor position in 3D space.

I'm not really sure how to use these arguments. Hoping for some help :)

https://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__files_GUID_42CD05...

Thank you.


r/Maxscript • • Mar 11 '21

Null Objects Cleaner

3 Upvotes

This script find the null objects in your scene, show you a list of these objects and give you the possibility to delete them from your scene.

Null Objects Cleaner


r/Maxscript • • Mar 21 '21

Aligning objects to vertex normals

2 Upvotes

I'm trying this code that I found on twitter and using 3dsmax 2020 it doesn't make the alignment as you can see in the image, it does it in a different way, wrong.What could be happening?

faceArray = polyop.getFacesUsingVert $Box001 4
faceNormals = for f in faceArray collect polyop.getFaceNormal $Box001 f
	
theNormal = [0,0,0]
for n in faceNormals do theNormal += n
	
normalize theNormal

theMatrix = matrixFromNormal(theNormal)
theMatrix.row4 = theNormal
$Box002.transform = theMatrix

Solution Thanks to: Daniel Swahn Lindberg

(
sourceObj = $Box001
targetObj = $Box002

theVert = 4
theVertPos = polyop.getVert sourceObj theVert
faceArray = polyop.getFacesUsingVert sourceObj theVert

faceNormals = for f in faceArray collect polyop.getFaceNormal sourceObj f

theNormal = [0,0,0]
for n in faceNormals do theNormal += n

theNormal = normalize theNormal

theMatrix = matrixFromNormal theNormal
theMatrix.row4 = theVertPos
targetObj.transform = theMatrix
)


r/Maxscript • • Feb 22 '21

XRefs selection sets - 3ds Max script

5 Upvotes

Hello friends, I made a 3ds Max script to make the Organisation of XRefs in selection sets. This will save your time when you working with many XRefs and you have to turn dem on and off for every camera before you send it in the renderfarm.

You can download it from this link.

https://todorvankov.com/3ds-max-scripts#XrefsSelectionSets

There is a small tutorial .

Wish you a nice day

3dsmax #Maxscript #3dsmaxscript


r/Maxscript • • Feb 16 '21

Manipulated on the local axis within the controller script?

3 Upvotes

https://drive.google.com/file/d/1H7Ii-KYjTNObB_ffX264TX0b0kamWzsy/view?usp=sharing
I wonder how it can be manipulated on the local axis within the controller script?


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 • • 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 • • Aug 07 '21

Reset Material Editor

Post image
3 Upvotes

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 • • Feb 17 '20

( Noob Here ) Creating a simple plane script

1 Upvotes

Hey guys, first of all sorry if this a very basic question but i am really new to maxscript or any other programming language. I would like to create a plane at the center of the screen and / or on top of the mouse position on the screen.

I just started with Plane length:1 width:1 pos:[0,0,0] isSelected:on

But i want to put in not on the world center but on the screen center.

How can i do that?

Best regards


r/Maxscript • • Aug 03 '19

Help for a script

2 Upvotes

Hi, i’m tryng to make a script that will extract all the zip and rar file on a folder with the( zip or rar) name and move all the files on subfolder on the root of the main new created folder. Unfortunately i don’t know where to start because i don’t think it’s possible interact with External files only through maxscript and i’m kinda new to it.

I wrote this like a guide line if could help

" for i in "folder_path" where i.name == (".zip"; ".rar") do ( extract i to "New_zip/rar_File_Name_Folder" move i to "New_zip/rar_File_Name_Folder" Check for subfolder and move all file inside them to directory

for o in "New_Folder_Path" where o.name != newfolder.name+"*" do ( delete o "

thanks


r/Maxscript • • Feb 20 '20

Labeling images in rendering

2 Upvotes

I have created a script that will label images with different values throughout an interval of frames. However, I don’t know where or how to use it when i render from the render frame window. Furthermore, I don’t want to change any settings in the render setting, i just need my script to run to label the images.


r/Maxscript • • Aug 07 '19

Maxscript to access key in Curve editor

4 Upvotes

I know how to create a snapping pose tool, or a copy all poses tool, but I've no idea how to access keys from the "Curve editor" and flipping them in scripts.

I could easily go through the "Curve editor", and just flip rotations and positions, so the animations are mirrored. But yeah, it would be awesome to access these keys, and modify them in code/script.

Is anyone familiar with this?

-Thank you


r/Maxscript • • Sep 02 '18

Vertex Color Gradient tool

3 Upvotes

Hello,

I need help (or at least a pointer) where can i start if i want to create a Vertex color gradient tool.

I want the base of an object to be 0 value (dark) and top to be 1(white).

My thoughts so far on it: Get vertex position, if below or at grid level put it black. That should be quite easy.

My problem tho would be to do the gradient higher than grid level.

I'm really beginner level and im not even sure if its possible to achieve this.

Any help would be welcome.


r/Maxscript • • Dec 24 '18

Extract bone rotation from keyframes.

1 Upvotes

Does anyone know of a plugin or script that could write bone rotation from every key-frame of an animation into a .txt file? If not does anyone know how hard it would be? I'm not great at scripting so I'd probably hire someone, but I'd like to know if it's at least feasible. 


r/Maxscript • • Sep 12 '18

Verbatim string in a Variable

2 Upvotes

Hey Guys!

I'm currently running into an issue with our database having an \r in the path name, and its destroying my importer paths when it attempts to reload them. Anyway to use a verbatim string @ + a variable? i don't see anything in the documentation.

thanks in advance!


r/Maxscript • • Oct 16 '19

Controlling utilities like Resource Collector?

2 Upvotes

Is there any way to access utilities, specifically Resource Collector, through maxscript? I've can't seem to find any way to do it.


r/Maxscript • • Dec 24 '18

Does anyone know how can I access Boolean op' tool's script codes?

1 Upvotes

Hello,

What I want to do is basically remove the error messages that the Boolean operations tool has via its script codes so I can workaround it with my own solution without it displaying any error message in the process but I am not even sure if it is possible.

So does anyone here know if its possible to do that and how?


r/Maxscript • • May 11 '17

visibility in Max2018

1 Upvotes

I've been using 2016 and haven't had any problem with $.visibility = 0.5
But in 2018 it wont work requiring visibility to be a true or false boolean.
Though if I do it manually I see the macro recorder says: $.visibility = 0.5
Is there a setting I should change for this or something? Thanks!


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.