How do I add an object to the pick list of a Projection modifyer?

Hello everyone!

I'm trying to add specific objects of my scene to the Reference Geometry List of a Projection modifyer.

I found out that it might has something to do with

AddPModObjects <array>node_list <boolean>createNew <boolean>deleteAll [objList :<array>]

(found that snipet @ http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=fil... )

To be honest I just don't know how to use this snipet.

here is where it should somehow be integreated:

		if (chkProjection.checked) and (chk32.checked) do
		(
			Plane length:320.0 width:320.0 pos:[0,0,0] isSelected:on
			modPanel.addModToSelection (Projection ()) ui:on
			$.name = "Projection_detail"
			newmat = StandardMaterial()
			newmat.name = ("default_X_Projection_detail")
			newmat.Diffuse = color 255 255 255
			newmat.ambient = color 255 255 255
			select $Projection_detail
			selection.material = newmat	
		)

this just runs as 2 checkboxes are ticked so the "to be picked object" is generated before.

Hope someone can help me on that!

Cheers,
zumpi

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
victorgilbert's picture

i spend years learning

i spend years learning similar codes, but this one is quite new for me. sounds really interesting. thanks for sharing the knowledge.

pixamoon's picture

Re: Add objects to Projection modifier

Hi,
Yes, you should just use AddPModObjects:

AddPModObjects #($Plane001) false false objList:#($Box001,$Box002,$Box003)

where:
1st is your Plane object with Projection modifier (but has to be in array list)
2nd false - if u want to add to existing modifier, (true will create new Projection modifier)
3rd false - false to keep objects on the list (true - to delete objects from the list)
and 4th parameter is optional. But in your case you want to add specific object from your list, so it has to be objList:#(objects array) If you don't use objList: it will open "pick objects window".

Hope this helps,
cheers,
Pixamoon

zumpi's picture

Oh dear! I wouldn't have

Oh dear! I wouldn't have never ever figured that out! Thank you so much! Maybe I should spend some more hours on terminology and basics of scripting! ;)

cheers,
zumpi

pixamoon's picture

Glad it helped,

No prob, always good to ask, We already spend hours on that.
Glad it helped,
cheers,

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.