mgear-dev / mgear4

mGear v.4.x.x (python 3 ready) https://mgear4.readthedocs.io
MIT License
259 stars 91 forks source link

Make a metadata for rotateOrder to store a default value in a controller. #328

Closed joji2468ng closed 7 months ago

joji2468ng commented 7 months ago

Storing the default as metadata in the control and updating the reset tool in mGear to use the metadata when there is a rot order attr.

Here is the reported issue in the forum. http://forum.mgear-framework.com/t/mgear-viewport-menu-resets-the-rotarte-order-always-to-xyz/3574

miquelcampos commented 7 months ago

@joji2468ng Please don't do this one, until I confirm. I think rot order should be keyable. We should check why it is resetting to XYZ

and I think I know why. We should be using change_default_value instead of setting it directly. That will change the default and the reset will work as expected image

joji2468ng commented 7 months ago

@miquelcampos I've already tried the command and I got the error below. The attribute rotateOrder isn't a dynamic attribute. so it seems like we can't change the default value...

You'll get this error once the command runs. # Error: RuntimeError: file C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pymel\internal\pmcmds.py line 217: 'rotateOrder' is not a dynamic attribute of node 'arm_L0_fk1_ctl'. #

if the rotate order should be keyable, storing its default value in the extra attribute of the control is necessary. This approach allows the value to be recalled during resetting.

miquelcampos commented 7 months ago

@joji2468ng Oh! I see, in that case we will need to search for another solution. For example storing the default as metadata in the control and update the reset tool in mGear to use the metadata when is a rot order attr

joji2468ng commented 7 months ago

@miquelcampos Yes, I was saying the same thing in my last paragraph. I found the solution that we can add a custom attribute name "RotateOrder" instead of metadata. The built-in attr name is "rotateOrder" so I will hide the built-in attr and then show a custom attr for rot order in the channel box to be able to change a default value.

miquelcampos commented 7 months ago

@joji2468ng Oh! sorry I missed that part 😝 Great that we are thinking the same hahaha!