Select all bones, including biped, and make it non renderable

Hi, Im trying write a script to preset the mos possible things in a scene for be ready to render, this include assign textures to certain objects, erase and replace some others, setting light and render parameters, and maybe more, for now, I have some of the code working, except the process for the textures (I dont start yet), and the one for make all bones (including biped) in a scene, non renderable. I have problems with the latter, helped me with the listener, I wrote the following:

clearSelection()
SetSelectFilter 8
actionMan.executeAction 0 "40021" -- Selection: Select All
if selection.count > 0 do(
$.renderable = false)
SetSelectFilter 1

When I evaluated, some times work, but some times not, and when I run it, never works.
Im very confused about this, I search in the maxscript help and in many websites for an other way to select all the items, or select by class, but I not found the answer.

Im relatively new in scripting, although I like to chop buttons and learn the most and best I can, hopefully can help me.

P.S. sorry for the English but I not speak it very well.

Comments

Comment viewing options

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

(for o in objects where

(for o in objects where classOf o == Biped_Object OR classOf o == BoneGeometry OR (try(classOf o.transform.controller == BipSlave_Control)catch(false)) collect o).renderable = false

Raphael 'Insanto' Steves
http://Graph.Net84.Net

hasielhassan's picture

Thats cool It works good with

Thats cool

It works good with the bones and the biped, except with ones I converted to editable poly for customize

seeketh to see if I can find other options

Much thanks :D

Swordslayer's picture

(for i in objects where

(for i in objects where isKindOf i BoneGeometry OR isKindOf i Biped_Object collect i).renderable = false

This way you basically loop through all the objects (for i in objects do ...), test if they are kind of a BoneGeometry or Biped_Object (the easiest way to get a object's class is to select it and type classOf $ in the listener), and if it meets the criteria you collect it. Then for the collection you set the property renderable to false (object properties assignment is mappable).

Another way (slower but maybe more comprehensive) would be:

for i in objects do
(
	if isKindOf i BoneGeometry OR isKindOf i Biped_Object do
	(
		i.renderable = false
	)
)

There you'd be working with single nodes (instead of an array of them) setting their renderable property individualy.

Comment viewing options

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