Topic - ETEREA Item & Shader Tree Buttons 1.3 • Updated December 2013

Page 1 of 2 12NextLast
Update December 23, 2013 • Version 1.3

— Icons are defined using the new 'Icons Grid' structure introduced with Modo 701. This means a better file management: Modo does not import a lot of small PNG files, one for each icon. There are just 2 'grid image' files now, one for medium icons (20 pixels) and one for large icons (32 pixels).

— I provide an alternate old version, compatible with Modo 601, but I won't update this, sorry.

- - - - - - - - - - - - - - - - - - - - - - - - - -

This is a small utility panel I have created to work with Items List and Shader Tree. The reason for this is that I particularly hate to call RMB-context-menus for operations that are frequently used. And all those tools and options buried under menus and submenus are something that cuts my workflow too.

Some buttons are for ItemList, some for ShaderTree and some are common. You have Tooltips for all buttons, read them the first time you use :-)



------------------------------------------------------------------------------------------------------------------------------

>>> Download Eterea Item & Shader Tree Buttons 1.3 <<< Compatible with Modo 701 and up

>>> Download Eterea Item & Shader Tree Buttons 1.2 <<< Compatible with Modo 601

------------------------------------------------------------------------------------------------------------------------------

CAUTION ALERT. Use these quick tools with caution, specially the DELETE button: you could be in Shader Tree and have some objects selected in the Item List, inadvertently. Or vice versa. As a rule of thumb it's a good idea to be sure that nothing is selected, then select your Items or Shader Tree components, and then press the buttons.

INSTALLATION. It's a kit: Translate to your Scripts folder, open Modo, create an empty palette, change to “Form View”, Min Header, load “Eterea Item & Shader Tree Buttons”, drop this panel to the suggested location in picture (just above the Item List / Shader Tree). I have done this for all tabs in Modo.

NOTE. If you have “EtereaUVTools” you can remove the “loadImageMap.py” inside this new kit, since that script was already present there (caution: do not delete “loadimagemap_menu.py”)

THIRD PART SCRIPTS INCLUDED (again, big thanks to authors):

group_or_add_grouplocator.py • group_or_add_groupmask_shad.py • duplicate_or_instance.py • by MonkeybrotherJr
delete_or_remove_empty.py • toggle_item_or_tex_visibility.py • have been created from the previous too.
loadImageMap.py • deleteEmptyLayers.py • by Mark Rossi aka Onim
loadimagemap_menu.py • by Dongju

--------------

SOME NOTES:

01. EYE Toggle visibility on all selected elements, Items or Shader Components.

— You have Items selected -> Hide Items
— You have Textures selected -> Hide Textures
— If you have both -> Message: “Caution: you have Items and Textures selected” and do nothing

02. PADLOCK Lock/Unlock. This is only for Items. Be careful if you press this over an ImageMap because you will Lock his TextureLocator ;-)

03. ORANGE DOT Deselect All, both Items and Textures. I frequently use this just before select anything (see CAUTION ALERT above).

04. GIOCONDA Add a Backdrop. No secrets here :-)

05. FOLDER For Items only.

— If you don't have anything selected > Add a Group Locator
— If you have some Items selected -> Group them into a Group Locator

(continue on next post)

Cristóbal Vila
etereaestudios.com

Message edited by Cristobal Vila on 6/26/2014 - 4:31 AM

06. LOCATOR, CAMERA, LIGHT

These buttons calls a macro that add items AND changes its size to 0.0. I hate that giant Locators, Cameras and Lights that are added using the default 1.0 size. In my opinion Modo should use 0.0 as Default, since it has the virtue to be “zoom-independent”. I EVER CHANGE these items to 0.0. And these 3 buttons are very convenient for me, because they create 0.0 sized items from scratch :-)

07. DUPLICATE AND INSTANCE For Items and ShaderTree Components.

These buttons calls to Duplicate and Instance (Hierarchyes, if you are in the Item List, but you can duplicate a single item too, of course). They work too for ShaderTree Components. Thanks to MonkeybrotherJr for this! :-)

— If you have some Item selected -> Duplicate / Instance
— If you have some ShaderTree Component selected -> Duplicate / Instance
— If you have both -> Message: “Caution: you have Items and Textures selected” and do nothing

08. DELETE For Items and ShaderTree Components (I repeat: special caution with this tool if you are not absolutely sure about what is selected ;-)

— If you don't have anything selected > Remove all Empty Meshes
— If you have some Item OR Shader Tree component selected -> Delete them

09. ADD RENDER OUTPUT, SHADER, GROUP MASK, MATERIAL These are obvious. Only a detail with GROUP MASK:

— If nothing is selected, add Group Mask
— If Shader Tree Components are selected, group them under a Group Mask. Thanks to MonkeybrotherJr for this! :-)

10. LOAD IMAGE MAP, ADD NOISE, ADD GRADIENT

This is one of the most useful parts, for me. Specially the “Load Image Map”, because it's hidden into a submenu: “Add Layer > Image Map > Load Image”. I want to say thanks to Dongju that helped creating a script for this and Mark Rossi aka Onim, creator of "loadImageMap.py" (loading an image map with a script it's not a trivial task).

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ETEREA MODO RESOURCES · You will find there all my shared tools and kits, with information in English and Spanish

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Cristóbal Vila
etereaestudios.com

Message edited by Cristobal Vila on 10/8/2013 - 11:16 AM

Thanks a lot. In scripts, I don't know, sorry.)

http://mymodo.ru
http://modostore.com

Message edited by ammbass on 12/10/2012 - 6:42 AM

01. THE EYE: TOGGLE VISIBILITY
item.channel locator$visible ?(0|2) - so works
Quote from Thirteenth Guest :
01. THE EYE: TOGGLE VISIBILITY
item.channel locator$visible ?(0|2) - so works


Thank you very much Thirteenth Guest! :-)
I have updated my first post with your fix.

Thanks too to ammbass for his GIF. I recommend translate this palette to a fixed position just above Item List & Shader Tree;-)

Cristóbal Vila
etereaestudios.com

Message edited by Cristobal Vila on 12/10/2012 - 9:58 AM

02. THE FOLDER: CREATE GROUP LOCATOR
and
04. DUPLICATE AND INSTANCE

You can make a script.
These queries help:
query sceneservice isType ? mesh
query sceneservice selection ? all
query sceneservice selection ? mesh
query sceneservice item ? #(some of the arguments may be useful)

Help > Scripting and Commands
Thanks again for your help, Thirteen Guest

The problem is I have no idea about coding :-(

I will try your suggestions, by looking at other scripts, when I have some time…

Thanks!

Cristóbal Vila
etereaestudios.com
Hi Eterea, these look great. I did a quick test for 02 and it seems to work:

#python
import lx

selmesh = lx.eval("query sceneservice selection ? all")

lx.out(selmesh)

if selmesh:
    lx.eval("layer.groupSelected")
else:
    lx.eval("item.create groupLocator")


Tell me if it doesn't work like you want.


/ The artist formerly known as Monkeybrother

Message edited by Rikard H on 12/13/2012 - 3:09 AM

Thank you very much MonkeybrotherJr, it works perfectly!

I have updated first post with this change:

— If you don't have anything selected -> Add a Group Locator
— If you have some Item selected -> Group them into a Group Locator

And other improvement referring to DELETE button too, and based on your script:

— If you don't have anything selected -> Remove all Empty Meshes
— If you have some Item OR Shader Tree component selected -> Delete them

Cristóbal Vila
etereaestudios.com

Message edited by Cristobal Vila on 12/13/2012 - 4:05 AM

And here's a quick hack for 04. DuplicateorInstance.py. I've only tested it on a test scene, so I can't guarantee that it's waterproof. Post back if it doesn't work.

Use without arguments to duplicate, use argument "instance" to instance, like so:

DuplicateorInstance.py instance


/ The artist formerly known as Monkeybrother

Thank you so much, MonkeybrotherJr!!! :-)

1. ABOUT YOUR LATEST “DUPLICATE” SCRIPT:

It works exactly as I described. It's great, but there is a small drawback:

When you select an ImageMap in the ShaderTree (or any other element that has a Texture Locator associated) the script gives the “You have both Items and Shader Tree…”. This is completely normal, but it's a pain, because Duplicating or Instancing Image Maps (or Noises or Gradients) is one of the most convenient tools.

I have thought about this possible “solution”:

— If only ITEMS are selected --> Duplicate (or instance) them using "item.duplicate false locator true true" (or "item.duplicate true locator true true").
— If only SHADER TREE COMPONENTS are selected --> Duplicate (or instance) them using "texture.duplicate" (or "texture.instance").
— If both a TEXTURE LOCATOR and a SHADER TREE COMPONENT are selected --> Duplicate (or instance) the ST component using "texture.duplicate" (or "texture.instance").
— If both ITEMS (no Texture Locators) and SHADER TREE COMPONENTS are selected --> Show the actual error.


Not sure if this could be easy or tricky to implement… :-/

>>> Here is a WIP version with your latest scrip included <<<

2. ANOTHER QUESTION:

I have tried to create another script based on your previous "group_or_add_grouplocator.py" script. What I want is to do the same for Group Masks in the Shader Tree, I mean:

— If you don't have anything selected in the Shader Tree > Add a Group Mask
— If you have some ShaderTree components selected -> Group them into a Group Mask

This is my attempt:

#python
import lx

seltextur = lx.eval1("query sceneservice selection ? all")

lx.out(seltextur)

if seltextur:
    lx.eval("shader.group")
else:
    lx.eval("shader.create mask")


It works at Grouping selected components when something is selected in the ShaderTree. But it fails at trying to simply add a Group Mask when nothing is selected.

Please, excuse my code ignorance :-)

Thanks for your great help, again, MonkeybrotherJr

Cristóbal Vila
etereaestudios.com

Message edited by Cristobal Vila on 12/13/2012 - 10:34 AM

No problem. About your questions:

1. I never noticed that behaviour when I tested it, but it should be fairly simple to fix.

2. This is probably very easy to fix as well.

I'll try to look at both tomorrow, when I'm pretending to work or waiting for a render.


/ The artist formerly known as Monkeybrother

Thanks for your quick reply, MonkeybrotherJr!

And take your time: do it only if you have some spare time, tomorrow, after tomorrow… next week… no hurry at all :-)

Cristóbal Vila
etereaestudios.com
I didn't even have to pretend to work, I've been waiting for feedback all morning and had the time to make some changes to the scripts:

For question 1:
I updated the script in my previous post: DuplicateorInstance.py

For question 2:
shader_tree_group_selected_or_create_group.py
The problem was that "shader.create mask" won't work if you have anything other than shader tree items selected.

Same as before, I haven't had the time to test thoroughly, so tell me if something doesn't work.


/ The artist formerly known as Monkeybrother

Thanks MonkeybrotherJr!:

1. But the “new” DuplicateorInstance.py scripts is exactly the same than previous, and it has the same problem (logically). When you try to duplicate an ImageMap (or Noise, or Gradient, or any ShaderTree component with a texture Locator associated) you get the “You have both Items and Shader Tree…” error.

I suppose that you have mixed up the new script with the old one… maybe?

2. The "shader_tree_group_selected_or_create_group.py" works PERFECT!

Thanks you for your great help! :-)

Cristóbal Vila
etereaestudios.com
I'm using dropbox for my links, maybe the script hadn't been uploaded or your browser had the old file cached. I renamed the file, so that your browser has to get the new version, try this: DuplicateorInstanceUpd.py

I'm happy to help, good to know that it works!


/ The artist formerly known as Monkeybrother

YES! This new version works like silk!

I will make and upload a quick update, and tomorrow will introduce some new enhancements (maybe new icons to better reflects common operations for both the ItemList and ShaderTree)

Thanks for your great and quick help, MonkeybrotherJr :-)

EDIT: first and second post are updated, with notes and new version.

Cristóbal Vila
etereaestudios.com

Message edited by Cristobal Vila on 12/14/2012 - 5:16 AM

MonkeybrotherJr: just a small note to say that I have modified (*) your "duplicate_or_instance.py" script to toggle Visibility both for the Items or the ShaderTree components. (point 01) And it works perfect! I have even deleted all line codes related to arguments and it's in good health! (take in consideration that I have NO idea about coding/programing) :-D

This is something adictive :-)

Thanks for your great help, MonkeybrotherJr.

(*) I mean: I have created ANOTHER script, based on yours.

Cristóbal Vila
etereaestudios.com

Message edited by Cristobal Vila on 12/14/2012 - 11:03 AM

Nice. That's how you get started, it is pretty addictive. And when you know some python, you basically know the basics of PHP and JavaScript and then it's just downhill from there.


/ The artist formerly known as Monkeybrother

very nice! thanks for sharing!
Thanks!

Stay tuned: tomorrow I will share a more refined and enhanced version ;-)

Cristóbal Vila
etereaestudios.com
DONE!
I have just updated the first post with the 101 release and new notes.
Hope this help your workflow! ;-)

Cristóbal Vila
etereaestudios.com
It works well, a good time saver. Thanks!


/ The artist formerly known as Monkeybrother

lOVE THIS SHORTCUTS great time saver thank you for sharing
really nice helper.

(what would be nice, if the light created would be an arealight, and another button for creating a luminous plane!)
group mask, as you said is somehow not needed because of the 'm' shortcut)
Page 1 of 2 12NextLast