PDA

View Full Version : how to target an incomplete name in a loop.


BebeteLANUITE
04-03-2006, 04:19 PM
Hello everbodies :thumbsup:

I'am back in scripting.
It's a big tool :)

I search a way to target a group of object in a scene.
Example:


For m in scenematerials where m.name == "object_*"?? do
(
m.specularlevel = 50
)--end for loop


I want to apply the change on all materials that the name begin by "object_" but i don't know the syntaxe for it.

Somebody has a solution.

Thank a lot for you help ;)

magicm
04-03-2006, 06:29 PM
.. where matchPattern m.name pattern:"object_*" do

That should do it ;)

Martijn

BebeteLANUITE
04-05-2006, 09:16 AM
Hello magicm !! ;)

Thanks a lot for your help. It works very well.
I made a simple tool to help me to manage a lot of material attributes of selected objects.
And i can select objects directly by a chunk of his name with the "matchpattern" you give me ;)

You know, i think, how it's "crazyfic" to change material attribute for a large group of object's material.
It drove me crazy to click on the material in the editor, change attributes, click another material, change attributes and this fifty times. :) looool

Thank you a lot for your help ;) thanks

CGTalk Moderation
04-05-2006, 09:16 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.