Loop

Hi Everyone
i have a script that loops through all the objects in the scene i just don't want it to loop through these objects "cam" and "point"
thanks in advance

rollout image_button_test "Image Button"
(
button theButton "Delete All PF_Source" width:90 height:20

on theButton pressed do
(
for OBJ in helpers do
(
print OBJ as string
print "next"
select OBJ
for i in 1 to $.count do
(
baseName = $[i].name
$[i].name = uniquename (baseName as string)
)
)
)
)
createDialog image_button_test 210 210

Comments

Comment viewing options

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

I have a noob question...

the condition: classOf OBJ != point or superClassOf OBJ != camera

Shouldn't that be an AND instead of OR ?

victorgilbert's picture

i also had the same concern

i also had the same concern with the cyliner001 object. thanks for the help that worked eventually.

miauu's picture

.

rollout image_button_test "Image Button"
(
	button theButton "Delete All PF_Source" width:90 height:20
 
	on theButton pressed do
	(
		for OBJ in helpers where ( classOf OBJ != point or superClassOf OBJ != camera ) do
		(
			format "OBJ: % \n" OBJ
			print "next"
-- 			select OBJ
-- 			for i in 1 to $.count do
-- 			(
				baseName = OBJ.name
				OBJ.name = uniquename (baseName as string)
-- 			)
		)
	)
)
createDialog image_button_test 210 210
Mrjacks2o's picture

Thanks

how about Names instead of P1 or camera lets say Cylinder001 or Dummy001?

miauu's picture

.

rollout image_button_test "Image Button"
(
	button theButton "Delete All PF_Source" width:90 height:20
 
	on theButton pressed do
	(
		--	use matchpattern to filter all objets which name starts with "Cylinder"
-- 		for OBJ in helpers where ( matchPattern OBJ.name pattern:"Cylinder*" ) do
		--	or matching the exact name
		for OBJ in helpers where ( OBJ.name == "Cylinder001" ) do
		(
			format "OBJ: % \n" OBJ
			print "next"
			baseName = OBJ.name
			OBJ.name = uniquename (baseName as string)
		)
	)
)
createDialog image_button_test 210 210

Comment viewing options

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