Color controller does not connect

How can a color switch be created such that whenever a controller is adjusted a random color is selected. I tried a simple circle, whose color property I changed to random, playing the animation changes, the color, which is fine. But my intention is to use a switch to change these random colors, I created a switch but it can not connect , it brings error. Is there a way this can be done, without first creating similar objects with diff colors & grouping them, but instead use one object with random color)

I’d love to answer your question but please provide more context. For example what type os switch do you intend to use?

Also, familiarize yourself with the types of values in Synfig. You probably tried to link 2 values that can’t be linked

Alright, from a simple circle, the controller switch should change the color of the circle randomly, whenever it is turned.

You can disable that animation by setting the speed property of node Random to 0.

You mean use “a controller to change these random colors” ?

Yes there is a way to do that,
Check if this solves your problem, you move the controller and the color is changed to random color.
Note: This doesn’t give you smooth transition between the colors, meaning that animating the controller would generate flickering effect

randomnessByController.sifz (1.0 KB)

It seems that you are following this tutorial ?
You are using the term “switch” in place of “controller” which is causing a little confusion.

The layer/valuenode which is used to control or manipulate other layer should be called Controller.

The title of original video is “Creating custom switch controllers in Synfig” which has gives people the wrong idea for it. Rather a title called “Custom Controllers for Switch Layer” would be much clear.

The term ‘controller’ makes everything clear.

If you want to select a random color from a set of predefined colors, then it would be a little complicated, if you want it, just say so, I will create one example.

1 Like

Thanks Alot, this is precisely, what I had expected to achieve. Though, I could not link, the exported value to the random color property, of the circle. Finally following through your file, I was able to achieve the same results. Great thanks to you.

This is great, I could also, use your, wise knowledge about this. May be you could also provide hit on this as well.

This is so true, the idea is also inspired by this tiny app, that generates random cartoon characters (generatoon, by rendermann, it’s created, by PureBasic, & it’s free on GitHub.)

Now the purpose, is to use this knowledge about random property, to see whether, it’s possible, to achieve the same, in Synfig. Initially I had thought of putting the idea in form of a plugin, but later, I think using controller would be easier


Here’s a demo with predefined colors:
randomFromPredefined.sifz (1.8 KB)

To add more colors follow the below instructions:

  1. Add a new solid layer in the “Colors” switch layer group. And set it to new color.
  2. Change the parameters of “Colors” switch layer group as follows:
    1. Expand the “Active Layer Depth” parameter
    2. Update the “Link” value to half of number of Solid Layers, meaning if you have 10 solid layers, set it to 5.
    3. Update the radius to half the number of Solid Layers, similar to above.

For what you are trying to achieve, I would recommend creating plugin, or you can take a look at SwtichTemplate plugin which may help you achieve your goal. Or you can study my plugin and create your own. (Feel free to DM me if you need help)

The file can’t open, there is an error

Try this:
randomFromPredefined(fixed).sif (12.3 KB)

I don’t get any issue while opening the file, which version are you using ?

I am on Synfig Release version 1.4.4

@rodolforg , you might need to take a look at this.

It now works, just fine thank you

I tried 1.5.0, 1.5.1, current master branch, 1.4.1, 1.4.2, 1.4.3 and they all worked.