Tagged 'General Scripting'

STICKY - Forum Guidelines

The ScriptSpot community is a place for professional artists, developers, students or others to come discuss relevent topics. Topics which are deemed inappropriate or inflammatory may be removed at moderator disgression. This is an open community, but it is not a place to air our differences - keep on topic and everyone will benefit from the collective knowledge here.

Content that does not adhere to the following guidelines may be removed or edited without warning at moderator disgression:

Create multiple global variables from an array

I had a situation where I needed to separate out each element of an array (in my case a Multi-dimensional array) to their own globals so I created a fn to do so.

It can set the globals to undefined also.

I made it work with any array type while I was at it.

It's a very edge case fn but here's the code for anyone that may need it.

If you have another method that doesn't involve the use of the execute function then I'd be happy to hear that. Or if you have any comments then please let me know.

  cnt = undefined ; local cnt = 13
  -- String class example.

Load new keyboard shortcut .hsx via maxscript

I want to load keyboard shortcut (.hsx) by firing maxscript, .hsx is located in a network path.

Thank you in advance!

Maxscript materials


I'm iterating over all materials in a selection in maxscript.
I want to replace the top/bottom materials with the bottom material from the current top/bottom shader.

I can't wrap my head around what I'm doeing wrong.
I don't see the result on the object in the material editor when I select an object with a top/bottom material on it ...

for o in $ where o.material != undefined do
if classOf o.material == topBottomMat then
copied_mat = copy o.material.bottomMaterial
o.material = copied_mat

Any ideas?


Booleans Bool3 - Create a nested sub-boolean with maxscript code.

Is it possible to create a nested boolean within a boolean (bool3) object with maxscript code. Example: I have a boolean (bool3) with some objects. Then I want to add a new object as a base object and use the other objects as a subtractive (nested) sub-boolean.

This is handy because I sometimes first need to subtract some objects from an object and use the resulting boolean object again as a subtract. I know you can place multiple booleans in the modifier stack, but I would like to solve it all within one bool3 with nested booleans.

face move script error

i made this script
this is script for moving face with 3 vertex
there is error
pls see attacef file

lastvetx = #()

curO = selection[1]

aFaces = (polyOp.getFaceSelection curO) as array

for selFaceBA in aFaces do

vertPos1 = polyop.getVertsUsingFace curO selFaceBA
vertPos = vertPos1 as array
vertPosArr = for v in vertPos1 collect (polyOp.getVert curO v).z
vertZmax = amax vertPosArr
topVertIdx = 0

m.connect #manual causing error in 2020

Hello everybody,

When i try to connect to BB manager using
"(m.connect #manual "flux-server" port:3234 platform:#64)"

My max2020 is showing a bunch of redfont error, c++ callback, virtual address etc.
The same code was working few days ago. And Max 2016 connecting perfectly still.

Its occurring in multiple pc. All scripts are same btw. What could go wrong? Do I need to install some hotfix or patch for maxscript?

Please friends, help me out. Thanks

to find the vertex with the most z value among the vertices of the selected face

hi frends .
good new year .

i have a question .

i made Triangular face.

i converted editable poly

in there

i would like to find the vertex with the most z value among the vertices of the selected face

I'm sorry for lacking

Loop to rename bitmap filename strings

Hi Everyone, let me give you a quick introduction to what has been happening to me.

I love 3D.
I am lazy.
I hate doing repetitive work.

Maxscript sounds like a marvel to do repetitive boring tasks sometimes necessary to handle 3D Asset Library work.

I started dipping my toes in Maxscript a few months ago, and managed to save quite a bit of time in automating everyday tasks.

Due to time constraints I've not delved into materials with maxscript yet (and I am a bit put off by the incomprehensible code that is coming out of the Maxscript listener when I give it a shot.

Syndicate content