Hi,
I’m new to mGear but have some experience in Python and Pymel. I have been experimenting a bit with mGear and it looks great!
I am wondering if there will be the possibility of globally setting the defaults shapes for controls based on their type. Taking arm_2jnt_01 as an example, I noticed the following pattern:
self.fk1_ctl = self.addCtl(self.fk1_npo,
"fk1_ctl",
t,
self.color_fk,
**"cube",**
w=self.length1,
h=self.size * .1,
d=self.size * .1,
po=vec_po,
tp=self.fk0_ctl)
It looks like addCtl() method from shifter.component.Main ultimately calls a method in mgear.core.icon that creates a curve with parameters based on a string argument (in this case “cube”). Since “cube” is hard-coded into the arm_2jnt_01 code, the default shape for this type of control likely can’t be changed without doing some weird stuff like redefining the “cube” function to actually return a circle, or something similarly weird.
If such functionality were to be implemented, I believe a first step would be to define a global enum or dictionary mapping control “types” to shape arguments, like
CTL_SHAPES = {
"FK": "cube",
"IK_Eff": "circle",
"IK_Pole": "flower",
...etc.
}
Or instead of a global, such a mapping could be assigned on a per-object basis, similar to how control colors are currently handled.
The addCtl() calls could then be modified to pass a dict value (e.g., CTL_SHAPES[“FK”]) instead of a literal string, while still preserving the ability to hardcode shapes for backwards-compatibility, if desired.
I guess this would require some kind of consensus on what the set of control types should be, though. Does this seem like something folks would be willing to implement? I’d be happy to help, with whatever time I can find.