Can anyone tell me where i'm going wrong?
Hi Guys,
I have a selection of camera's in my scene. Some start with "cam_" other don't. I want to use matchpattern to select the camera's that do start with this prefix. Below is what I have been trying to use. Please could someone tell me where i'm going wrong, don't think i'm too far off, i just cant find the right syntax. Also it would be great to know how to search two matchpaterns in the same for loop if possible.
for i in cameras where matchpattern i.name pattern:"cam_*" collect i
Any help would be much appreciated!
Comments
Thank you both for your
Thank you both for your answers. Seems it was working after all then :-). Think I was trying for so long that 3DMax gets a bit buggy and doesn't run execute the code. Shut 3DMax done, restarted and all seems fine!? :-) Many thanks again!
.
Tools and Scripts for Autodesk 3dsMax
That code is working for me
Hi, I ran the code in a simple scene with some cams and it works for me (see image). Are you sure the error is not in the rest of your code (could be a 'logic error' also)?
"Also it would be great to know how to search two matchpaterns in the same for loop if possible."
If I understand correctly (correct me if I'm wrong) you'd like to have a loop run only if two matchpatterns return as true.
This would be the way to do it:
if (test1==true) and (test2==true) do ( some code )
which is the same as
if (test1) and (test2) do ( some code )
(when the if/and loop receives two values of 'true' the code will be run)