Set all splines within a layer the same colour

Hey team,

Not sure if this is possible by default in Silhouette, don’t think it is but correct me if I’m wrong. But this should be fairly simple to knock up right as a tool?

Make a layer the colour blue for example and then select the layer, run the tool, and all the roto shapes inside that layer would also change colour in the viewer to blue. (or whatever colour you set).

Or perhaps for lots of layers, select the amount of layers you want, run the tool and select the colour you want all the splines inside to be through the tool…

It’s been requested a few times to me but not had any time to look into it further. What do you think?

1 Like

You can change attributes of multiple objects at once: just select them, then change a parameter, and it will apply to all of them. You can also click on the color pot or other settings in the Object List and they will all change to the new value.
For your example, select the Layer and all of its children, then change the Layer color.

How do you select a layer and then all of its children (everything inside it) quickly. I thought it would be Actions > Select > Siblings but it doesn’t quite do that. Using v7.5

Add this action to your resources/scripts/actions folder. Create a file called “selectChildren.py” and paste the code in below. You can also open a Script Editor window and just paste it in there and press Execute whenever you want to run it.

from fx import *
from tools.objectIterator import getObjects

class SelectChildren(Action):
	"""Selects all children of selected objects."""

	def __init__(self):
		Action.__init__(self, "Select|Children")

	def available(self):
		assert len(selection()) > 0, "Select one or more objects"

	def execute(self):
		objects = selection()
		
		for s in selection():
			children = getObjects(s.children)
			for child in children:
				if child not in objects:
					objects.append(child)
		
		beginUndo("Select Children")
		select(objects)
		endUndo()

if __name__ == "__main__":
	SelectChildren().execute()
else:
	addAction(SelectChildren())

That’s perfect, thanks very much Paul!

I had to add fx.addAction(SelectChildren()) then run that as a function at the end of the script just simply due to network permissions at work only being able to run custom Silhouette code from one user defined .py file and not the original installation folder. Always a bit of a pain. (if that makes sense)

All the best!

1 Like

check this script, it will do exactly what you want.

http://boundaryvfx.com/download/525/

for other sscripts.

2 Likes

Thanks Magno!

Ah awesome, didn’t realise that was there. Have installed a number of your tools from your site, the ImportCornerPin being my personal favourite. Being able to instantly copy tracks from Mocha & Nuke sped up workflows so much pre 2020.

All the best.