Mar 14, 2019

Adding "Select Parent" command to Cinema 4D

1. Run the script manager, menu Script ➩ Script Manager
2. Choose Python (for C4D below R20)
3. Start new script, menu File ➩ New File
4. Paste the code into the code field
import c4d

def main():

    doc.StartUndo()
    s = doc.GetSelection()
    for x in s:
        try:
            p = x.GetUp()
            doc.AddUndo(c4d.UNDOTYPE_BITS, x)
            x.DelBit(c4d.BIT_ACTIVE)
            doc.AddUndo(c4d.UNDOTYPE_BITS, p)
            p.SetBit(c4d.BIT_ACTIVE)
        except:
            pass
    c4d.EventAdd()
    doc.EndUndo()
    
if __name__=='__main__':
    main()
as shown on the picture
5. You can render (current viewport) or load the icon for your script using File ➩ Render or File ➩ Load Icon
6. Save your new script File ➩ Save the script
7. Push the Shortcut button on the bottom right, assign your own key
8. Save your C4D config

You're done

No comments:

Post a Comment