This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def get_random_color(pastel_factor = 0.5): | |
return [(x+pastel_factor)/(1.0+pastel_factor) for x in [random.uniform(0,1.0) for i in [1,2,3]]] | |
def color_distance(c1,c2): | |
return sum([abs(x[0]-x[1]) for x in zip(c1,c2)]) | |
def generate_new_color(existing_colors,pastel_factor = 0.5): | |
max_distance = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import c4d | |
from c4d import gui | |
# In this video let's talk how to create layers, | |
# apply it to objects and change it attributes with Cinema 4D Python SDK. | |
# Check out tutorial here: | |
# https://mikeudin.net/?p=8680 | |
def GetFirstLayer(doc): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# localimport-v1.7.3-blob-mcw79 | |
import base64 as b, types as t, zlib as z; m=t.ModuleType('localimport'); | |
m.__file__ = __file__; blob=b'\ | |
eJydWUuP20YSvutXEMiBpIfmeOLDAkJo7GaRAMEGORiLPUQrEBTVkumhSKK75Uhj5L+nHv2iSNpyf\ | |
BiTXY+uqq76qpoqy+qsP/SyLIv4t+a5rVT0vleiU1o0XfSDdM8dEf95PFVNm9f96V28KstPQqqm71\ | |
D4Kf9H/jZeNaehlzqq++Fqn49tv7PPvbJPw/PxrJvWvqqro2hZ1WJX1c924aUZDk0rVs0B2XK7adM\ | |
d+s2bbVF8v15Fe3GIGi1OKrmk8BpJoc+yiy45L6aOQy5xScspWiWWNbaN0olTe4de0klMqmz7umoT\ | |
dKarTiIbKv0B9aGMXSx6leN6Xu0U/u+4YatDLyNcK/E9gvOxCnBPR5hocBRQETVkiDrvRsozz4O6r\ | |
AP/lWexsi8/VxAY64lVgH9AWIqOvNDyyv63SHCWmPcR9yoSl1oMOvpf1Z7FT1L2MggdbRa5va1C1F\ | |
if5b6REcSi67Wl5EpXUqs/GtiFdkUejrv4VLXlEDqr4FiAnO2F0sVvfScyzjRFL+gHRAmJ4GmES2g\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
How to connect bezier spline points to objects | |
and control tangents with Python Tag in Cinema 4D. | |
View tutorial and get project files here | |
https://mikeudin.net/?p=7503 | |
Author : Mike Udin | |
Web-site : mikeudin.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import c4d | |
""" | |
Cinema 4D XPresso Python Node. | |
Resize Spline to two point separated segments. | |
Required ports: | |
SegmentCount(Integer) | |
Spline(Link) | |
""" | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import c4d | |
from c4d import gui | |
#This script required Cinema 4D R20 and upper | |
def main(): | |
objs = doc.GetActiveObjects(0) | |
if not objs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import c4d,webbrowser | |
# Check tutorial and | |
# download project file here: | |
# https://mikeudin.net/?p=6900 | |
#### 1 #### | |
#Python Tag placed User Data Button | |
def message(id,data): | |
if id == c4d.MSG_DESCRIPTION_CHECKUPDATE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import c4d | |
def apply_axis(op,new_m): | |
loc_m = ~new_m * op.GetMg() #Get local matrix | |
op.SetAllPoints([loc_m.Mul(p) for p in op.GetAllPoints()]) | |
op.SetMg(new_m) | |
op.Message(c4d.MSG_UPDATE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import c4d | |
def main(): | |
ps = op.GetAllPoints() #Points in Local coordinates List | |
m = op.GetMg() #Object Global Matrix | |
center = op.GetMp() #Local coordinates center: https://tinyurl.com/wed88cn | |
rad = op.GetRad() # Geometry radius: https://tinyurl.com/tb6vn64 | |
NewerOlder