dR_symmetrize not available in mayabatch?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to programmatically symmetrize a mesh. I figured out how to execute that in mel/Python, but it seems it does not work when in mayabatch.
Manually, I would select whatever I need to be symmetrized (vertices), go to the menu 'Edit mesh | Symmetrize', select a mesh edge for symmetry, and that would be it. What I am doing to programmatically automate this is:
from maya import mel
mel_symmetrization_cmd_str = 'activateTopoSymmetry(<0>, <1>, <2>, "vertex", "cmds.dR_symmetrize", 1);'
mel.eval(mel_symmetrization_cmd_str)with <0>, <1> and <2> being the data I need (ie. <0>: mesh edge for symmetry; <1>: vertices that I want to symmetrize; <2>: node name).
It works great when executing this inside a scene in script editor, but fails when in mayabatch:
STDOUT: Error: line 0: Cannot find procedure "dR_symmetrize".
WARNING: Error: line 0: RuntimeError: file python_module.py line 72: Error occurred during execution of MEL script
I tried adding source to drInit.mel, and also made sure the modelingToolkit was loaded, but it didn't help.
Is there something specific to do/call/add? Where does the function 'dR_symmetrize' come from? Can it be used in mayabatch? If not, is there another way to automate a mesh symmetrization?
Thanks for your help!
PS: I am using Maya2020.3.