Skip to content

Instantly share code, notes, and snippets.

@MikeUdin
MikeUdin / Place_Selected_To_Connect.py
Last active September 25, 2016 08:54
Place Selected Objects To Connect
import c4d
# Welcome to the world of Python
# Author: Mike Udin, http://mikeudin.net
# 2016
def main():
objs = doc.GetActiveObjects(1)
if not objs: return
doc.StartUndo()
@MikeUdin
MikeUdin / Create Materials for Selected Objects.py
Last active September 26, 2016 15:34
Create Materials with Checkerboard shader for Selected Objects
import c4d
from c4d import gui
from random import randint
# Welcome to the world of Python
# Author: Mike Udin,
# Tutorial here http://mikeudin.net/?p=2915
# 2016
def randomColor(x,y):
@MikeUdin
MikeUdin / Create text file.py
Last active January 24, 2021 12:25
How to create text file, read and write info
import c4d
from os import path as p
from c4d import gui
# Welcome to the world of Python
# Author: Mike Udin,
# Tutorial here https://mikeudin.net/2016/10/06/cinema-4d-python-tips-working-with-text-files/
# 2016
def main():
@MikeUdin
MikeUdin / ParentObject_FromPopUpMenu.py
Created October 11, 2016 14:54
Place selected objects as childs to Parent from popup menu
import c4d
from c4d import gui
# Welcome to the world of Python
# Author: Mike Udin,
# Tutorial here http://mikeudin.net/?p=2930
# 2016
def main():
objs = doc.GetActiveObjects(1)
@MikeUdin
MikeUdin / QuickFolder.py
Created October 11, 2016 14:59
Open in Explorer/Finder folder from customizable popup menu
import c4d
from os import path as p
from c4d import storage as st
from c4d import gui
# Welcome to the world of Python
# Author: Mike Udin,
# Tutorial here http://mikeudin.net/?p=2930
# 2016
@MikeUdin
MikeUdin / Select instaces with same reference object.py
Last active January 5, 2017 12:27
Select instaces with same reference object
import c4d
# Check out tutoral here
# http://mikeudin.net/2017/01/05/cinema-4d-python-recursive-hierarchy-iteration/
def recur_iter(obj,ref):
while obj:
if obj[c4d.INSTANCEOBJECT_LINK] == ref:
obj.SetBit(c4d.BIT_ACTIVE)
recur_iter(obj.GetDown(),ref)
@MikeUdin
MikeUdin / SweepNObject_from_EdgeSelection.py
Created January 10, 2017 18:36
Script creates new Sweep Nurbs object from selected edge
import c4d
from c4d import utils
# This script creates new Sweep Nurbs object from selected edge
# Author: Mike Udin,
# Tutorial here http://mikeudin.net/2017/01/10/cinema-4d-python-send-modelling-command
# 2016
def main():
@MikeUdin
MikeUdin / ToogleTools.py
Last active June 26, 2017 11:09
Toggle Tools Example
import c4d
# Toggle selecting between different tools
# Author: Mike Udin
# http://mikeudin.net
def main():
values = (200000083, # Live Selection
200000088, # Move
@MikeUdin
MikeUdin / ToogleBoolParameter.py
Created June 26, 2017 11:14
Cinema4D Python Toogle Script Example: ToogleBoolParameter.py
import c4d
# Toggle selecting render settings Render Region parameter
# Author: Mike Udin
# http://mikeudin.net
def main():
rd = doc.GetActiveRenderData()
rd[c4d.RDATA_RENDERREGION] = not rd[c4d.RDATA_RENDERREGION]
@MikeUdin
MikeUdin / Toggle_selected_objects_visibility.py
Created June 26, 2017 12:35
Toggle visibility of the selected objects in Cinema 4D scene
import c4d
# Toggle selected objects visibility in Editor and Renderer
# SHIFT - toggle visibility in Editor only
# CONTROL - toggle visibility in Renderer only
# Author: Mike Udin
# http://mikeudin.net