My collection of Maxon Cinema 4D scripts. Made by @aturtur. Almost all scripts are commented to make learning Python scripting for Cinema 4D easier, faster and nicer. You can find more of Cinema 4D related stuff on my blog like: Generators, Effectors, Xpresso rigs etc. I share here scripts that I have wrote mainly for myself. Some scripts are for really specific tasks, some might be a bit old and obsolete and some are quite weird and experimental. Nonetheless, all scripts are done for learning purposes and having fun (and to help day to day work).
Version: 1.0.2 (Updated 09.10.2020)
- 09.10.2020 AR_EasePaste.py: Major bug fix.
- 07.10.2020 AR_ResizeCanvas.py: Added support for non-perspective projections (e.g. parallel, isometric etc.)
- 07.10.2020 AR_ToggleTintedBorder.py: ALT-modifier, change border color with hex color code
In this section I go through how you install AR_Scripts to your Cinema 4D. These scripts are written for Maxon Cinema 4D R21.207 using Python version 2.7.14. Scripts are tested using Microsoft Windows. All of the script might not work with Mac.
Use at your own risk!
Scripts should be installed to the folder where scripts have priviledges to write files, since some takes advantages for that. Download this repo and put AR_Scripts folder to following path:
C:\Users\<USER>\AppData\Roaming\MAXON\Maxon Cinema 4D RXX\library\scripts
/Applications/MAXON/CINEMA 4D RXX/library/scripts
Other way to find folder for installing scripts is to opening C4D and opening preferences (Ctrl+E / Cmd+E) and pressing 'Open Preferences Folder...' -button and navigating to library > scripts.
When you have installed AR_Scripts you have to reboot Cinema 4D if it is already running. On start up Cinema 4D will scan scripts and you can find those under Extensions -> User Scripts -> AR_Scripts (R21). Script can also be found in commander (Shift+C).
You run the script simply by clicking it. Some scripts have multiple functions and you can use those with key modifiers (Alt / Ctrl / Shift) and different combinations.
Puts axis to center of the selected object(s) (works only with editable objects). If non-editable object is selected, tries to move the object to center of the children (does not support render instances).
Bakes selected cameras to world space. It might feel that when running the script Cinema 4D freezes, but the script is just calculating. Give it some time. Preview range determines the baking range.
Bakes selected object(s) to point level animation (PLA) in world space. Preview range determines the baking range.
Default: Bakes selected object(s) to PSR animation in world space. Shift: Bakes selected object(s) to PSR animation in local space. Preview range determines the baking range.
Boole multiple objects with a single click. Creates intances of one 'booler' with PSR-constraint. Default: First selected object is booler. Ctrl: Last selected object is booler. Shift: Creates a huge booler cube.
Creates a boole setup from two selected objects that creates a piece effect. Shift: Uses instances.
Consolidates different polygon selections together that uses same materials. Messes up with material projection. Uses object selection.
Copy selected tag(s) to selected object(s).
Default: Creates a copy from the first selected object to the child of the rest of the selected objects. Shift: Creates a copy from the last selected object to the child of the rest of the selected objects. Ctrl: Creates an instance from the first selected object to the child of the rest of the selected objects. Ctrl+Shift: Creates an instance from the last selected object to the child of the rest of the selected objects.
Create control null objects from selected point(s). Control nulls have frozen PSR by default.
Creates a folder null for easier organizing. I use this when I'm not using my Separator Null. Requires C4D R21. If there are selection, selected objects will be grouped under to the folder null. Shift: Assign folder null's layer to selected objects. Doesn't overwrite existing layers. Ctrl: Assign folder null's layer to selected objects. Overwrites old layer.
Creates a guide object from two selected objects or two selected points.
Creates (clones) own materials for selected object(s) from existing materials.
Creates a spline(s) multiple different ways. Sometimes also with dynamics!
Default: Creates a simple two point spline on Z-axis. Shift: Creates a simple two point spline on Y-axis. Ctrl: Creates a simple two point spline on X-axis.
Default: Creates a dynamic spline from a static spline with controllers on both ends (user input for subdivision). Shift: Creates a dynamic spline from a static spline with controllers for every spline point (user input for subdivision).
Default: Creates a one static spline from selected objects' positions. Shift: Creates multiple static splines betweeen selected objects. Ctrl: Creates a one dynamic spline from selected objects (user input for subdivision). Ctrl+Shift: Creates multiple dynamic splines from selected objects (user input for subdivision).
Creates null object(s) with constraint tag (clamp) from selected point(s) or creates null objects with constraint tag (PSR) from selected object(s).
Default: Creates a vertex map tag for selected object(s) Shift: Creates a vertex map tag with linear field object.
Default: Distributes selected keyframes evenly. Shift: Give step (in frames) to distribute (user input).
Removes selected tag type from selected objects. If there is no object selection, selected tag type will be doomed in whole project.
Default: Copies easing of selected keyframes in Timeline editor. Shift: Copies easing of selected keyframes in F-Curve editor.
Default: Pastes copied easing to selected keyframes in Timeline editor. Shift: Pastes copied easing to selected keyframes in F-Curve editor.
Exports top level objects individually to OBJ file. Does not export animation.
Exports selected spline objects to Adobe Illustrator file sequence. Preview range will determine which frames will be exported. Don't use very complex shapes. Check my After Effects script to import file sequence to Masks or Shape Objects. Shift: Export objects to separated folders. Note: Do not use any special charactes in your objects names, do not even use a dot (.).
Default: Import image folder to materials. Shift: Generates image planes.
Imports OBJ-files from selected folder to the active document.
Merges selection tags from selected objects. You can also select only tags that you want to merge together. Tags have to be same type.
Creates MoGraph Selection Tag for every single clone. Note: If you have nested MoGraph generator, disable parent generator(s) before running this script.
Creates MoGraph Selection Tag for every single clone that are selected.
Default: Create MoGraph Selection Tags from given range (user input). Shift: Create one MoGraph Selection Tag from given range (user input).
Aligns selected graph nodes horizontally. Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Aligns selected graph nodes vertically. Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Default: Connect nodes, if possible. Priorities empty ports. Works with multiple node selections. The node that are located the most left is the node that is outputting connections. Shift: User input - which port is outputting to which port. Ctrl: Same as the default function, but start at the last port. Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Disconnect all connection(s) of selected node or connection(s) between selected nodes. Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Distributes selected nodes horizontally. Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Distributes selected nodes vertically. Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Default: Lines up selected graph nodes horizontally. Shift: Lines up selected graph nodes horizontally by given amount (user input). Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Default: Lines up selected graph nodes vertically. Shift: Lines up selected graph nodes vertically by given amount (user input). Works in Xpresso graph and in Redshift material graph. Xpresso tag or Redshift material has to be selected before running the script.
Adds quickly Redshift matte AOV to selected material(s) and object(s) and material tag(s). Requires Redshift. Make sure that you have already set Redshift as your render engine for the document.
Creates shared scale, offset and rotate control nodes for selected Redshift texture and triplanar node(s). Requires Redshift. Redshift material has to be selected before running the script.
Converts selected object(s) to splines.
Opens the folder in explorer where the project is saved.
Opens the folder in explorer where the project is rendered. Supports some tokens, but not all. Supported tokes: $prj, $res, $camera, $take, $fps. Supports folder variables: './../'.
Create materials from Pixeur color palette file.
Prints selected object(s) type (ID) to console. Script for scripting.
Default: Sets random display color to selected object(s). Shift: Sets random grey value to selected object(s). Alt: Resets display colors to selected object(s).
Default: Randomize order of selected objects in Object Manager. Shift: Sort selected objects in alphabetical order (A-Z). Ctrl: Sort selected objects in reversed alphabetical order (Z-A). Objects have to be in same level in the hierarchy.
Default: Creates a reference view port for helping to animate stuff. Shift: Create reference background. Ctrl: Delete reference setups. Note 1: You have to enable 'Full Animation Redraw' in Preferences/View. Note 2: If you cant see the reference plane, try to change 'View Clipping' settings in 'Project Settings'.
Removes empty selection tags from selected object(s) or if no selection all possible ones in the whole project.
Default: Removes texture tags that does not have assigned material. Shift: Remove texture tags with missing selection tags.
Removes all tags. If object(s) selected removes tags only from selected object(s).
If there is no selected objects, script will remove every texture tags in the whole project. If there is selected object(s), script will remove texture tags from selected object(s).
Replace objects with instance/copies of first/last selected object. Default: Replace objects with instances of the first selected object. Shift: Replace objects with instances of the last selected object. Ctrl: Replace objects with copies of the first selected object. Ctrl+Shift: Replace objects with copies of the last selected object.
Resizes canvas without changing the perspective. Changes active render settings resolution and selected/active camera's sensor size (film gate) and possibly also film offsets. Note: If you don't have custom camera active or selected, script will modify default viewport camera's settings. You can reset default viewport camera with "View -> Frame Default".
Selects the active camera in the object manager.
Default: Select objects that are visible in editor. Shift: Select objects that are visible in render. Alt: Select objects that are invisible in editor. Alt+Shift: Select objects that are invisible in render. Ctrl: Deselect objects that are visible in editor. Alt+Ctrl: Deselect objects that are invisible in editor. Ctrl+Shift: Deselect objects that are visible in render. Alt+Strl+Shift: Deselect objects that are invisible in render.
Default: Select children of selected object(s). Shift: Keeps also original selection selected. Ctrl: Select children from given level (+Shift: Keep old selection). Alt: Select siblings from given level (+Shift: Keep old selection).
Default: Selects the object's Cousins. Ctrl: Deselect original selection.
Default: Select children of selected object(s) that are the most deep in hierarchy. Shift: Keep the original selection.
Default: Selects the first child object(s). Shift: Keeps the old selection. Ctrl: Safe mode (keeps the last selected if next not found).
Selects MoGraph Effector(s) that use(s) selected Field. Selects MoGraph Effector(s) that are used in selected Generator. Does not support subfields or tags.
Default: Selects every odd object in the object manager. Shift: Select every even object in the object manager. Ctrl: Select every nth object in the object manager (user input). Alt: Select reversed nth object in the object manager (user input). Supports object selections.
Selects MoGraph generator(s) that use(s) selected effector. Prints info also to console.
Default: Selects the next object(s). Shift: Keeps the old selection. Ctrl: Safe mode (keeps the last selected if next not found).
Default: Select tag(s) object(s). Shift: Keeps the old selection.
Default: Selects the previous object(s). Ctrl: Deselect original selection.
Default: Selects the root object(s). Shift: Keeps the old selection.
Selects object(s) with the same diplay color that the active object has.
Default: Selects the object's siblings. Shift: Keeps the old selection. Ctrl: Safe mode (keeps the last selected if next not found).
Default: Selects the source object. Supports Instance, Connect, MoInstance, MoSpline, Cloner and Matrix objects. Shift: Keeps also original selection.
Default: Select object(s) tag(s). Shift: Keeps the old selection.
Default: Selects the parent object(s). Shift: Keeps the old selection. Ctrl: Safe mode (keeps the last selected if next not found).
Default: Sequences selected animation tracks. Shift: Set custom gap (frames) (values can be negative and positive). Ctrl: Sequences selected animation tracks in ascending order. CtrlShift: Ascending order + set custom gap. Note: Select whole tracks, not just keyframes!
Sets current MoGraph weights to new MoGraph weight map tag.
Default: Shifts selected tag(s) one step to the right. Shift: Shifts selected tag(s) one step to the left.
Splits object to individual objects by polygon selection tags.
Default: Swaps selected objects between each other. Shift: Swaps also objects place in the hierarchy.
Shoots ray from the selected camera(s) and creates a focus null(s) to closest hitting point. Not recommended with heavy scenes. Very experimental script.
Meant to be a replacement for the default 'Q' (Toggle Parent Generator) command. Default: Enables or disables every possible selected generator. Shift: Toggle next parent generator that is in the specific generator list. Ctrl: Toggle root generator that is in the specific generator list. Alt: Toggle generator family that are in the specific generator list. To make the script work like it is meant to be assing Q, Shift+Q, Ctrl+Q and Alt+Q shorcuts to the script in 'Customize Commands...' editor!
Toggle grid visibility in viewport.
Default: Toggle opacity of tinted border in viewport. Shift: Set the custom opacity value. Ctrl: Toggle tinted border, but leave guide lines. Alt: Set custom border color with hex color code.
Inverts selected Vertex Map tag's data.
Default: Cycles through different background gradients for viewport. Shift: Default gradient (R21). Ctrl: Dark gradient theme. Alt: Cycles through user gradients. Alt+Ctrl: Set gradient by name (user input). Alt+Ctrl+Shift: Open txt-file for saving user gradients. Use hex color codes (#0000, #FFFFFF). Basic gradients: Houdini, Maya, Dark, Old Cinema 4D, New Cinema 4D. Note: Change is permanent.
If you find these scripts useful, consider to supporting me. It helps me to do more of these scripts and keeps my blog running. Make a tiny donation: Tip jar
If you have any script ideas, you can DM me at Twitter.