Tagged 'General Scripting'

Group Attaching

Tell me please, I just want to make the same operation like simple attach group tool! I need to use this:

attachNodesToGroup

I know that I can use

on atachbtn click do 
( 
   attachNodesToGroup selection <targetNode> 
) 

but how to define targetnode that will be a group? It means that selection should be attached to the picked group=>finally it will be a group as well! How to pick a group by script? Thx in advance!

on atachbtn picked obj do 
( 
   if isValidNode obj AND isGroupHead obj do 
   print obj.name 
)

doesn't work for me

defining an array as a custom attribute

Ok, at the moment, I am trying to make an array as a custom attribute.. Only problem, I'm getting the following weird error:

-- Error occurred in anonymous codeblock; filename: J:\Dropbox\ICT312 (1)\scripts\entityAttribs.ms; position: 579; line: 30
-- Unable to convert: #() to type: String

for the following code:

newAttrib = attributes entityAttrib
(
	parameters posParam rollout:entParams
	(
		isStatic type:#boolean ui:isStatic checked:false
		castShadow type:#boolean ui:castShadow checked:false
		isChild type:#boolean
		childeren type:#()
	)
 
 

handles

Hi I am trying to select an object by it unique handle. I can find out what the handle is (see below) what I dont know is how to select the object via its handle. Can anyone help?

$.handle (Returns the unique id associated with the node)

Thanks

Gram

Question about "Execute"

Hello,

i have a simple question, i am a little bit lost with maxscript, so, if you can help it will be so nice ;)

i think its probably really simple, my question is: Do you know an alternative to "execute" to do this stuff :

fn LogoPreset1 = ( print "logo1" ) 
fn LogoPreset2 = ( print "logo2" ) 
fn LogoPreset3 = ( print "logo3" ) 
 
rollout testrollout "test" width:272 height:120 ( 
	dropdownlist dd items:#("hello","hello world","hello you") height:6 
	button addb "add logo" pos:[50,35] width:125 height:32 
 
	fn w = 
		( 
			z = dd.selection as string 

Press Radio button with Maxscript in Command Panel

I want to press a radio button in the command panel. Someone asked how to press a checkbox in a 3dsmax menu (I have included the link). I am trying to press a radio button in the Command Panel: Proboolean --> (sub-object Operations) --> (Remove or Copy or Inst). These settings are not exposed in maxscript unfortunately. I tried your solution for the checkbox but it does not seem to work for radio button. Can someone help me?

selection loop with a clause

I wonder if someone could point me in the right direction with this:

I have modified a script that converts all scene materials to plain random coloured materials.

I am trying to add a clause, so the script ignores materials that have a refraction colour less than black and/or have refractance map enabled.

The script as I have it is attached (it has been written to function with Vray).

Any help would be massively appreciated!

Thanks

Danny

Create Render Element for each layer

Hi all,

I would like to create a script which add automaticaly a C_Masking render Element for each layer composed of this objects.
I already succed to create a render element for on layer but i don't know how create a loop which scan all layers in a scene.

Can you help me ? :)

Thank you in advance

Wire Objects position to anothers vertex

Is it possible to wire an objects position to another objects specific vertex position?

Supress warnings especially MassFx

Was wondering if there was an easy way to suppress all warnings via maxscript when opening a file in 3ds max. Especially the massFx warning.

Thank you!

How to create a record button?

How to create a dontnet button to display one image when pressed once, and another - when pressed second time(for example red and grey)

		--btn = dotnetobject "Button"
                dotnetcontrol btn "System.Windows.Forms.Button" pos:[667,101] width:15 height:15 border:false
		--btn.FlatStyle = btn.FlatStyle.Flat
                btn.flatstyle = dotnetobject "System.Windows.Forms.FlatStyle" Flat
 
                btn.Location = dotNetObject "System.Drawing.Point" 1 prevh
               i=1
             if i==1 then
             (