Blender Switch Layer Script

A place to discuss non-Moho software for use in animation. Video editors, audio editors, 3D modelers, etc.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Blender Switch Layer Script

Postby dkwroot » Sun Jan 22, 2017 3:50 am

DEMO: https://s29.postimg.org/mqjm99x87/Blender_Switch.gif

INFO: This tool creates a panel in the viewport that you can use to rapidly switch out objects. Simply make the objects you want to swap out into children of a control object. With the control object selected, click the "Next" or "Prev" buttons to switch to either the next or previous child object.

EXTRA INFO: The switch tool uses scaling to hide and reveal child objects. This is especially useful as it is compatible with many game engines. It is also compatible with the grease pencil, simply make grease pencil layers linked to empties and place the empties into a controller layer.

SCRIPT DOWNLOAD: https://drive.google.com/open?id=0Bwzk-fAhFYDzYXNOa1FoX2xFcUU


EDIT:
I updated the script so that it now toggles an objects visibility and render visibility as well as its scale. This saves on memory. I also added two buttons that will decrease/increase the resolution of textures so that the user can use low resolution images for animation and high resolution for render. Again, this is to save on memory and make production a little smoother. Just make sure your images have the words (large) or (small) in their name.

For example, Hand.closed.(large).png and Hand.closed.(small).png will be swapped out using the resolution option.

EXTRA:
I also have a photoshop script that will swap out the name (large) with (small) or (small) with (large). This makes it easier to prepare a rig for exporting to Blender.

DOWNLOAD: https://drive.google.com/open?id=0Bwzk-fAhFYDzN3RIS2psM0NyejQ


EXTRA-EXTRA:
Also, if you guys aren't already using ndee's cutout tools, I highly recommend this addon. It allows the user to easily export from photoshop or gimp to Blender and rig in Blender. It works great with my scripts as well.

DOWNLOAD: https://github.com/ndee85/coa_tools
Last edited by dkwroot on Wed Feb 01, 2017 1:46 pm, edited 3 times in total.
User avatar
dkwroot
 
Posts: 618
Joined: Thu May 02, 2013 6:56 am
Location: USA

Re: Blender Switch Layer Script

Postby rave » Sun Jan 22, 2017 4:16 pm

Hi,
it looks awesome,
unfortunately, I am stupid – can not install your script. How I can run it?
rave
 
Posts: 48
Joined: Sun Mar 20, 2005 8:44 pm

Re: Blender Switch Layer Script

Postby dkwroot » Sun Jan 22, 2017 4:54 pm

If you're using windows and installed the 64 bit version of Blender to the default location, you would simply drop the file into this folder:
C:\Program Files\Blender Foundation\Blender\2.78\scripts\startup

If you're using the 32 bit version of Blender, place the script in: C:\Program Files (x86)\Blender Foundation\Blender\2.78\scripts\startup

If you're using a Mac, just try to find where you installed Blender and place the file into the folder called startup.
User avatar
dkwroot
 
Posts: 618
Joined: Thu May 02, 2013 6:56 am
Location: USA

Re: Blender Switch Layer Script It is cool!

Postby rave » Sun Jan 22, 2017 8:05 pm

Tank you very much for these. It is awesome!

Best greetings
rave
 
Posts: 48
Joined: Sun Mar 20, 2005 8:44 pm

Re: Blender Switch Layer Script

Postby dkwroot » Thu Feb 02, 2017 10:56 pm

I just updated this script. Switch layers will now also toggle visibility to save system memory. The switches will also work with nested switches!

I also added the ability to swap out image resolution imported textures. This will allow the user to use low resolution images during animation and then swap to high resolution ones for rendering. Just make sure to have two copies of images in the same folder location, one must contain the words (large) in its name and the other (small).
User avatar
dkwroot
 
Posts: 618
Joined: Thu May 02, 2013 6:56 am
Location: USA

Re: Blender Switch Layer Script

Postby rave » Sat Feb 04, 2017 12:37 am

If I play with your script, I am surprised, that all the objects in the empty get the same size! Size of the empty – what make I wrong?

It would be great to have a button to "stop" the script – so all the objects in the empty are available and visible for editing – can you understand?
rave
 
Posts: 48
Joined: Sun Mar 20, 2005 8:44 pm

Re: Blender Switch Layer Script

Postby dkwroot » Sat Feb 04, 2017 5:17 am

rave wrote:If I play with your script, I am surprised, that all the objects in the empty get the same size! Size of the empty – what make I wrong?

It would be great to have a button to "stop" the script – so all the objects in the empty are available and visible for editing – can you understand?


The direct child objects of a parent object will have their scale set to 0 or 1, depending on whether they are active or not. The nested layers aren't affected.

If you want to keep an objects scale, then just make it a child to an empty and put the empty into the switch object. Then then empty will have it's scale changed, while the child's scale will be left alone.

The hierarchy should look like this:

Switch Object (EMPTY)
----Child Object (EMPTY)
---------NESTED OBJECT (MESH)

The child object's scale will change when you use the switch buttons on the switch object, but the nested object's scale will not change.
User avatar
dkwroot
 
Posts: 618
Joined: Thu May 02, 2013 6:56 am
Location: USA

Re: Blender Switch Layer Script

Postby rave » Sat Feb 04, 2017 12:29 pm

Hi,
you are right it works fine.
Thank you.
rave
 
Posts: 48
Joined: Sun Mar 20, 2005 8:44 pm


Return to Other Software

Who is online

Users browsing this forum: No registered users and 3 guests