Closed groolot closed 2 years ago
Hello my friend,
Widgets with identical ids do sync indeed (as per this) and it's what you've witnessed here because fragments acts like clones unless the widgets in the fragment are manually scoped (for example, by post-fixing their id). It's very likely you'll want to override other properties in the fragment as well such as the knob's address. The common pattern for this in o-s-c it to define a set of arbitray variables in the fragment container's variables
property and override them using the props
property of the fragment widget:
osc_demo.json.txt frag_instrument.json.txt
Now the widgets in the panel all have an id that depends on one of the panel's variables, this allows us to create a scope for these widget (see how the knob's target is defined now). As an example I also set the knob's address to @{parent.variables.address}
to show how we could create multiple variants of this fragment.
Ok, it's a bit confusing to have several ways to achieve the same result. Thus I will change the way I create patches. Thank's big boy!
Yes it's not ideal, features have been added on top of each others over the years and some redundancies could be removed now but at the cost of breaking many existing sessions..
The
osc_demo.json
file is master file and integrates thefrag_instrument.json
as fragment. Both of them have a knob calledknob_1
. Events seems to be propagated to each of them. A move on one actor the other.The goal of
clone
should be this behavior.The value transmission should'nt be done with an inheritance mechanism as described in https://openstagecontrol.ammd.net/docs/widgets/advanced-syntaxes/#javascript-js-code ?
Cheers my friend.