Classes??

How would i find the CLASS of a selected object

How would i find the PARENT CLASS of a selected object

And how would i Apply a class-specific action to all valid objects in a scene.

If you can answer any it would be a great help

Also what is a class specific action

Thanks?

Comments

Comment viewing options

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

you need to print the value

you need to print the value that "classof selection[1].parent" returns like

c = classof selection[1].parent
print c

Never get low & slow & out of ideas

barigazy's picture

And you need to start to read mxs help even more ;)

Try now

try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "• • •"
(
	button classbutton "Find Class Of Selected Object" width:190 pos:[5,5]
	button classparentbutton "Find Parent Class Of Selected Object" width:190 align:#left pos:[5,30]
	on classbutton pressed do 
	(
		if selection.count == 0 then messageBox "Select some objects!" else
		(
			for o in selection do format "ObjectName: % ; ObjectClass: %\n" o.name (classof o)
		)
	)
	on classparentbutton pressed do
	(
		if selection.count == 0 then messageBox "Select some objects!" else
		(
			for o in selection do 
			(
				if o.parent != undefined then
				(
					format "ObjectName: % ; ParentName: % ; ParentClass: %\n" o.name o.parent.name (classof o.parent)
				)
				else format "ObjectName: % ; ParentName: -- ; ParentClass: --\n" o.name
			)
		)
	)
)
createDialog bgaRoll 200 55 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

barigazy

barigazy's picture

--CLASS of a selected

--CLASS of a selected object:
classof selection[1]
--PARENT CLASS of a selected object
classof selection[1].parent

for more info read this topic http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=fil...

barigazy

Shade926's picture

Im not getting back any

Im not getting back any feedback within the listenr am i meant too?

This is part of my code:

)
button classbutton "Find Class Of Selected Object"
on classbutton pressed do
classof selection[1]

button classparentbutton "Find Parent Class Of Selected Object"
on classparentbutton pressed do
classof selection[1].parent

)
createDialog test_button 500 500

Comment viewing options

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