Python or Coffee



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/11/2011 at 02:45, xxxxxxxx wrote:

    Here a Newbee-Question:

    I have to do repeating several changes in a projekt like:
    ---
    select al polygon objects
    change to point-mode
    selekt all points
    optimice
    ---
    or
    ---
    select al polygon objects
    change to polygone-mode
    selekt all polygons
    untriangulate
    ---
    or
    ---
    select all UV-Tags
    delete all selected Tags

    Now my Question:
    What ist the best way to solve the problem?
    Phyton or Coffee
    Does anybody have an example for the problems at the top.

    Thanks



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/11/2011 at 05:44, xxxxxxxx wrote:

    Hi Ronald,

    I think you should use the "Script Log" (located in the "Script" menu). Its help page ("Script Menu" -> "Script Log") contains useful information on how to use it.
    This editor allows you to write a Python script just by recording the actions you perform in CINEMA 4D. Just like a macro recorder.

    For example I get the following Python code when
    I create a Cube
    Make the cube editable
    Activate Points mode
    Call optimize on the cube

    import c4d
    from c4d import documents, plugins
    #Welcome to the world of Python
      
    def main() :
        c4d.CallCommand(5159) # Cube
        c4d.CallCommand(12236) # Make Editable
        c4d.CallCommand(12139) # Points
        c4d.CallCommand(14039) # Optimize...
      
      
    if __name__=='__main__':
        main()
    

    Yannick



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/11/2011 at 06:36, xxxxxxxx wrote:

    Hi Yannick,

    thanks for your replay.
    My main-problem is not to find the "CallCommand"!
    My main-problem is to select all polygon objects or a normal-tag.
    There must be a way to select all and than proceed a modification like
    delete!
    Does anybody out there kow a way to select all polygon-objects??

    Thanks a lot



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/11/2011 at 07:52, xxxxxxxx wrote:

    It might help to go to my website and download the CoffeeBible:https://sites.google.com/site/scottayersmedia/scripting

    It could use another update. But I've stopped updating it because Coffee is fading. And Python is taking over.
    But it's full of things like grabbing objects, points polygons, etc.. and lots of other common tasks that might help you get started.

    -ScottA


Log in to reply