CallCommand
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/11/2011 at 13:46, xxxxxxxx wrote:
Probably a noob oversight here, but I can't figure out how to access the options when I call a command like 'Untriangulate' using
c4d.CallCommand(14050) # Untriangulate...
These options which would normally appear in a floating dialog if the user clicked the 'extended options' box next to the 'Untriangulate' text on the menu. (For reference, I would like to alter the angle and specify to create n-gons.)
I notice that the auto-generated comment in the Script Log has a '...' after the command name, which it appears to add for commands such as this one with further options to set; still, for the life of me, I can't figure out how to set them.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/11/2011 at 14:45, xxxxxxxx wrote:
Most of the things that modify an object like that are done with the SendModelingCommand() :
import c4d from c4d import utils def main() : obj = doc.GetActiveObject() bc = c4d.BaseContainer() bc.SetData(c4d.MDATA_UNTRIANGULATE_NGONS, False) bc.SetData(c4d.MDATA_UNTRIANGULATE_ANGLE_RAD, .5) utils.SendModelingCommand(c4d.MCOMMAND_UNTRIANGULATE, list = [obj], mode = c4d.MODIFY_ALL, bc=bc, doc = doc) c4d.EventAdd() if __name__=='__main__': main()
The SetData() parts are used to change those attributes you see in those dialogs.
Those attributes are documented a bit clearer in the C++ SDK. It shows a tree view of them and how they relate to their parent command. In this case MCOMMAND_UNTRIANGULATE.I also have a tutorial on the SMC if you want more info on it:https://http://sites.google.com/site/scottayersmedia/scripting
-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/11/2011 at 07:19, xxxxxxxx wrote:
Awesome, this is quite helpful! My colleague and I were thinking that maybe the SendModelingCommand was the way to go, but as you pointed out, the C4D Python SDK is... lacking, to say the least. Coupled with the fact that support is so recent, I have indeed had better luck looking at example COFFEE scripts. If the C++ docs are a good reference, I'll have a look at them. I'll also take a look at those tutorials. Thanks again!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/11/2011 at 07:40, xxxxxxxx wrote:
To get the most info out of the docs. It's not unusual to have to look at the Python, C++, & the Coffee docs to figure something out.
-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/11/2011 at 07:54, xxxxxxxx wrote:
Duly noted. Thanks again!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/11/2011 at 04:17, xxxxxxxx wrote:
Originally posted by xxxxxxxx
To get the most info out of the docs. It's not unusual to have to look at the Python, C++, & the Coffee docs to figure something out.
One of my long-term goal is to have self-contained documentations so developers don't have to look at the 3 documentations to get all the information...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/11/2011 at 08:17, xxxxxxxx wrote:
Sounds great Yannick.
-ScottA