THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/07/2011 at 15:16, xxxxxxxx wrote:
Can someone please point out to me what I'm doing wrong with the execution of this code? I can't seem to get it to take the settings in the base container field. As you can see I've tried three different ways to set this value, none of them seem to take. The script works but it just executes with the default value, not with the one I want to specify. Many thanks. Also - the only object in the scene is a linear spline with two points.
import c4d from c4d import utils from c4d import documents doc = documents.GetActiveDocument() def main() : settings = c4d.BaseContainer() # settings = 10 settings[c4d.MDATA_SUBDIVIDE_SUB] = 10 # settings.SetData(c4d.MDATA_SUBDIVIDE_SUB, 10) utils.SendModelingCommand( command = c4d.MCOMMAND_SUBDIVIDE, list= [doc.GetFirstObject()], mode=c4d.MODELINGCOMMANDMODE_ALL, bc = settings, doc = doc) c4d.EventAdd() if __name__ == '__main__': main()