Creating Shelves and Buttons via scripting

Discussions concerning programming of SOFTIMAGE©
Post Reply
User avatar
Loki
Posts: 12
Joined: 19 Jun 2009, 17:07

Creating Shelves and Buttons via scripting

Post by Loki » 20 Jun 2013, 19:16

Hi all

I'm trying to find a way to create a custom Shelf and Buttons via script (I'm using Python)
I looked at the SDK help and here around and in other blogs/forums...but I found only something about CreateToolbar (not Shelf!!!) and CreateToolbarButton commands, but them seems to be not so useful for what I want to do.

My idea is to create a script that build a custom Shelf only if it doesn't exists and then add a bitmap button on it.

The CreateToolbar command adds a toolbar only (and not Shelves as I want) in the User toolbar folder (should be perfect if I can choose the Workgroup toolbar folder) and the CreateToolbarButton command doesn't permit to sets bitmaps for the button appearance.
Next, after creating this Toolbar and Buttons, I'm not able to add more buttons on it, due to the GUID added as suffix to the toolbar filename.


Someone can help me, please?

Thanks,
Loki
(sorry for my english)

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 15:31
Skype: csaezmargotta
Location: Sydney, Australia
Contact:

Re: Creating Shelves and Buttons via scripting

Post by csaez » 24 Jun 2013, 18:36

I'm not sure there's SDK to work with shelfs but you can parse the file by yourself, it's a simple text file (xml structure) :)

User avatar
Loki
Posts: 12
Joined: 19 Jun 2009, 17:07

Re: Creating Shelves and Buttons via scripting

Post by Loki » 25 Jun 2013, 08:54

Hi csaez and thanks for your reply!
You're right! The next day I opened (by mistake!) a toolbar with the Script Editor and saw that it's a simple XML code. I didn't know it!
This made my code a little more complex, especially to modify an existing toolbar instead of create it... But seems to work :)

Thanks again,
Loki
(sorry for my english)

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests