Navigation

    • Register
    • Login
    • Search
    1. Home
    2. WDP
    3. Posts
    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups

    Posts made by WDP

    RE: After id exeetzer axis alignment

    Hi!
    I still have a problem with my script, I would like only the axes to align, and not the object like now, would be great if you could help me?
    Thanks very much!

    from typing import Optional
    import c4d
    
    doc: c4d.documents.BaseDocument  # The active document
    op: Optional[c4d.BaseObject]  # The active object, None if unselected
    
    def main() -> None:
        # Called when the plugin is selected by the user. Similar to CommandData.Execute.
    
        # Get the selected objects in the active document.
        selected = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
    
        # The fixed global position all objects should be set to.
        pos = c4d.Vector(0, 0, 0)
    
        # Iterate over all selected objects and set the global position of each.
        for obj in selected:
            # Get the global matrix of the object, set its offset and write it back.
            mg = obj.GetMg()
            mg.off = pos
            obj.SetMg(mg)
            obj[c4d.ID_BASEOBJECT_USECOLOR] = c4d.ID_BASEOBJECT_USECOLOR_ALWAYS
            obj[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(0.5, 0.8, 0.3)
            obj[c4d.ID_BASEOBJECT_GLOBAL_ROTATION] = c4d.Vector(0, 0, 0)
            obj[c4d.ID_BASEOBJECT_USECOLOR] = 1
    
                     # Push and update event to Cinema 4D.
        c4d.EventAdd()
        #Drop it Flor
        c4d.CallCommand(1041642)
    
    if __name__ == '__main__':
        main()
    
    posted in Cinema 4D SDK •
    After id exeetzer axis alignment

    Hello, I would like to write a script where you set the axis alignment for all angles to zero, according to the Picture, maybe someone can help me, would like to insert the function into an existing script.axis2.png axis1.png

    posted in Cinema 4D SDK •
    RE: BaseObject.SetModelingAxis(self, m) Not Working

    Thanks for the script but I just want the axes to change to 0,0,0 and the object to keep the original orientation.

    posted in Cinema 4D SDK •
    RE: Modul import

    Thank you very much!

    posted in Cinema 4D SDK •
    Modul import

    How can I import and run modules I've written in Nodepad++ in Cinema Python?

    posted in Cinema 4D SDK •
    RE: Script Befehl

    Thank you very much!!

    posted in Cinema 4D SDK •
    RE: Script Befehl

    Hi!
    Sorry I'm new to Python and still have to learn a lot, I've tested the Github example thanks for that, but I still can't get a keyframe to control my object visibility in Stage Animation?
    It would be very nice of you if you could help me again.
    Thank you very much!

    posted in Cinema 4D SDK •
    RE: Script Befehl

    Thanks for the script that deletes a key frame, but do you also have a script that adds the key frame?

    posted in Cinema 4D SDK •
    RE: Visibility Toggle

    Hello tried the script it switches from off to undef, how do I switch from off to on?


    import c4d
    from c4d import gui
    
    def main():
    
        allobj = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
        for obj in allobj:
            obj.SetEditorMode(obj.GetEditorMode() % 2 + 1)
            obj.SetRenderMode(obj.GetRenderMode() % 2 + 1)
    
    
    if __name__=='__main__':
        main()
        c4d.EventAdd()
    

    and how do i add the key frame?

    Thank you very much!

    posted in Cinema 4D SDK •
    RE: Script Befehl

    allmost alll functions in C4D have a Script ID and there is no script command for editor visibility and rendering visibility of Renderer( Key Frame) for a Animation? I have an animation and would like to only undef objects from the keyframe for editor visibility and render visibility per Key Frame, why isn't there a script command for these two functions?
    Tried the Git Hub sample that only creates new objects.
    I just want a script command that lets you control the (attributes base editor visibility and render visibility / Key Frame).
    Do you also have a tip for me why can I only control individual objects and not several with this script?
    Thank you very much!

    import c4d
    
    def main():
        """ Toggles both the render and editor visbilty of the active object.
        """
        if op is None:
            return
    
    
        if op.GetEditorMode() == c4d.MODE_UNDEF:
            op.SetEditorMode(c4d.MODE_ON)
            op.SetRenderMode(c4d.MODE_ON)
    
        elif op.GetEditorMode() == c4d.MODE_OFF:
            op.SetEditorMode(c4d.MODE_UNDEF)
            op.SetRenderMode(c4d.MODE_UNDEF)
    
        else:
            op.SetEditorMode(c4d.MODE_OFF)
            op.SetRenderMode(c4d.MODE_OFF)
    
        c4d.EventAdd()
    
    
    if __name__=='__main__':
        main()
    
    posted in Cinema 4D SDK •
    RE: Script Befehl

    I mean the adtribute palette / base / editor visibility and render visibility key frame i can't find a script command for this click function?
    Thank you very much!

    posted in Cinema 4D SDK •
    RE: Script Befehl

    M_Magalhaes Thank you for your answer, I'm sorry that I expressed myself so wrongly and asked the same question again.
    Have you a tip for me, how the keyframe command is for a Python Script?
    Thank you very much!

    posted in Cinema 4D SDK •
    RE: Script Befehl

    Thank you kudos! for the nice Answer!

    posted in Cinema 4D SDK •
    RE: Script Befehl

    Ok Sorry I Post the next Trhead in English.
    That was the Google translator!

    posted in Cinema 4D SDK •
    RE: Script Befehl

    Wenn ich ein Python Funktion mit einen Objekt ausführe funktioniert Sie ganz normal wenn ich jedoch mehrere Objekte Auswähle funktioniert die Funktion nicht gibt es da vielleicht ein Script dafür?
    Dankeschön!

    posted in Cinema 4D SDK •
    Script Befehl

    Benötige den Python Script Befehl für Sichtbarkeit im Editor und Sichbarkeit beim Rendern, habe keinen Python Script Befehl gefunden können Sie mir bitte weiterhelfen? Red Button
    Dankeschön!!Picture.png

    posted in Cinema 4D SDK •
    RE: Halt Script Manger Script Execution to invoke "mouse commands"

    Hi!

    One more question, why does it process the command gui.MessageDialog('Hide Object[s]') first, is it pretty much last in the order of commands?? How do I have to install the command so that the program runs according to the order in which it was entered?
    Thank you very much!

    posted in Cinema 4D SDK •
    Halt Script Manger Script Execution to invoke "mouse commands"

    Hello community,

    how can I halt the execution of a Script Manger script, execute "mouse commands", and then resume the script? I have attached an example at the end oy my posting.

    Cheers
    WDP

    [edited by @ferdinand]

    def main():
        """
        """
        # doc is a predefined module attribute ("variable") in a Script Manager
        # context pointing to the active document and equivalent to
        # c4d.documents.GetActiveDocument().
    
        # Get the selected objects in the active document.
        selected = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
    
        # The fixed global position all objects should be set to.
        pos = c4d.Vector(0, 0, 0)
    
        # Iterate over all selected objects and set the global position of each.
        for obj in selected:
            # Get the global matrix of the object, set its offset and write it back.
            mg = obj.GetMg()
            mg.off = pos
            obj.SetMg(mg)
            obj[c4d.ID_BASEOBJECT_USECOLOR] = c4d.ID_BASEOBJECT_USECOLOR_ALWAYS
            obj[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(0.5, 0.8, 0.3)
            obj[c4d.ID_BASEOBJECT_USECOLOR] = 1
            c4d.CallCommand(12102) # Axis
            c4d.CallCommand(440000121) # Active snapping
            # How can I halt the script at this point and evaluate "mouse commands"
            # at this point.
            gui.MessageDialog('Hide Object[s]')
            c4d.CallCommand(600000020) # hide objects
            
    if __name__ == '__main__':
        main()
    
    posted in Cinema 4D SDK •
    RE: select subobjects assign command

    Thank you for the Information I go next Year to a Python programming course i hobe that help me hopefully.
    Thank you for all Informationen

    posted in Cinema 4D SDK •