Request: easy way to delete a flag on multiple objects?

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Request: easy way to delete a flag on multiple objects?

Postby Aloys » Thu Nov 15, 2007 5:11 pm

Ok I give up and I ask for help...

I am deseperately looking for a way to delete any given flag on several objects at the same time.

Blender has very limited features to manage properties on multiple objects, in fact it has none beside the copy/paste trick.. Unfortunately with Ahra Pahts I am dealing with thousands of objects (nearly 3500 currently) and sometimes for various reasons I need to delete a given tag on dozens or hundreds of them at the same time and there is no easy way to do that. So I have to do it by hand and obviously it's awfully time-consuming.... (I could explain why I need to delete flags rather than adding them but it'd be too long for this post). I use Sjaak's 'Uru Properties 1.03' script which is very useful but cannot do that (PaladinOfKaos PRP GUI script doesnt work anymore on the latest versions of Blender). I just spend nearly two hours frantically clicking to delete the 'name' flag on 477 objects and I'd really want it to be one of the last times.. :cry: Because I know I will need to do it again in the future as I will add more objects.

I know it's kind of a big request but could someone devise a script that could delete any specific flag on all selected objects? Maybe it could be incorporated in Sjaak's script (I'd request that to him directly but I haven't seen him on Cobbs in a while), or it could be a separate script, heck it could even be a prompt command or a separate software, honnestly I'll take anything.

Pretty please? Someone need to save this Age and my sanity.. :(
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: Request: easy way to delete a flag on multiple objects?

Postby Nadnerb » Thu Nov 15, 2007 6:21 pm

Is it possible that instead of deleting the flag entirely, you can simply change (and copy) it to use an invalid value? You can even change the flag type from string or float. (all that need be the same is the name, and any values will be overwritten)
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Request: easy way to delete a flag on multiple objects?

Postby Robert The Rebuilder » Thu Nov 15, 2007 6:33 pm

Hold on to your sanity, Aloys - I'll see what I can do. At the very least, I can write a script that deletes the "name" property from all objects; I might be able to make it more general. Give me a moment...
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Re: Request: easy way to delete a flag on multiple objects?

Postby Robert The Rebuilder » Thu Nov 15, 2007 7:16 pm

OK - here's the script:

object_delete_property.py

Download this and place it in your .blender/scripts directory.

Load your model into Blender.

Change one of your panes to the Scripts window.

From the Scripts menu, choose Object->Delete Object Property

A popup dialog appears. In the field that says "Property Name:", enter "name" (without the quotes) and hit enter. Then press the OK button. After a short pause, it will tell you how many objects it deleted the property from.
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Re: Request: easy way to delete a flag on multiple objects?

Postby Aloys » Thu Nov 15, 2007 8:20 pm

Oh dear.. Thank you!! That's exactly what I needed! It works perfectly. (actually it works on all the objects in the scene, not only on those selected; but that's a minor issue I can circumvent, don't worry about that)
I just did in 30 seconds several changes that would otherwise have taken me litteraly hours...
Thank you, that made my day. :)
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests