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.
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:
- Add a new solid layer in the âColorsâ switch layer group. And set it to new color.
- Change the parameters of âColorsâ switch layer group as follows:
- Expand the âActive Layer Depthâ parameter
- Update the âLinkâ value to half of number of Solid Layers, meaning if you have 10 solid layers, set it to 5.
- 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.