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 get_points_id_selected(obj): | |
buffer_list = list() | |
pts_count = obj.GetPointCount() | |
sel_pts = obj.GetPointS() | |
list_pts = sel_pts.GetAll(pts_count) | |
for i in xrange(pts_count): | |
if list_pts[i]: |
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 | |
import random | |
#create a selection for each polygon | |
def create_poly_selection(obj): | |
poly_count = obj.GetPolygonCount() | |
tags = list() | |
for i in xrange(poly_count): | |
#create the tag and name it by poly_id | |
tag = c4d.SelectionTag(c4d.Tpolygonselection) |
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
""" | |
* ---------------------------------------------------------------------------- | |
* "THE BEER-WARE LICENSE" (Revision 42): | |
* Gr4ph0s wrote this file. As long as you retain this notice you | |
* can do whatever you want with this stuff. If we meet some day, and you think | |
* this stuff is worth it, you can buy me a beer in return :) | |
* ---------------------------------------------------------------------------- | |
""" | |
import c4d |
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
# coding: utf-8 | |
""" | |
A GeUserArea Exemple for display multiple content. | |
Hardly based on https://github.com/NiklasRosenstein/c4d-2048 from Niklas | |
""" | |
__author__ = 'Adam Maxime - Graphos <gr4ph0s(at)hotmail.fr>' | |
__version__ = '1.0' | |
import c4d |
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
#CSV Importer exemple by graphos | |
#12/07/2017 | |
#More informations about csv structure => https://www.c4dcafe.com/ipb/forums/topic/99062-can-objects-be-created-with-python/ | |
import c4d | |
import csv | |
def add_mesh(num, name, r_h, p_x, p_y, outer_radius): | |
#Create obj in memory | |
disc_obj = c4d.BaseObject(c4d.Odisc) |
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
#Set axis rotation of an object (didn't support spline in bezier mode) | |
#17/07/2017 | |
#More informations about csv structure => http://frenchcinema4d.fr/showthread.php?81748-Besoin-d-aide-pour-un-code-python | |
import c4d | |
def LocalToGlobal(obj, local_pos): | |
obj_mg = obj.GetMg() | |
return obj_mg * local_pos | |
def GetPointGlobal(obj): |
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
# coding: utf-8 | |
""" | |
Exemple for get / set VertexMap inside c4d through python. | |
Show an exemple of GetLowlevelDataAddressR / GetLowlevelDataAddressW | |
""" | |
__author__ = 'Adam Maxime - Graphos <gr4ph0s(at)hotmail.fr>' | |
__version__ = '1.0' | |
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
""" | |
Exemple for add / get marker inside c4d through python. | |
24/08/2017 | |
More informations => https://www.c4dcafe.com/ipb/forums/topic/99715-xpresso-using-marker-data/ | |
""" | |
import c4d | |
def get_all_marker(doc): | |
markers_list = list() |
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 zlib, base64 | |
exec(zlib.decompress(base64.b64decode('eJy9G2tzIkfuu3/FLF8WcoT1a727riMVG7y7VIztMthXqVyKtKENc54HNzPY5n79Sa1WP2YAY+dyqVroltRqtR7dknDCeJ5mRTA+nOyENISvnSJbHu8EGpDJST4L74sd+TyW8wIQc5HnO+MIPoOeohnKvJBZvVjOZQPwo+/iUZ5KmXREFMlJ+6uIcgngjkiIniE/KyaxLGbpZCeYyHugmcnxA1HVx1HehH8XIlZsg/A+gGmrxB4xIGSxyBJCm20AQScJ8Cyt+zCZjOJ0sohkndkizl/UHmYL6bDUUzq8Pu9ZlqWZ4sv8g9GI1DUaebzXMS9xX8c+mGdhUmzLXGvVctcApdjRGLRFDJo/iGwKnz88POGAdZukxVr90k6ObWrsFrWGYxkji2uUfDEH53A9Ba3aaBmRSuKgtkFulwUdhFyuLwvRF0U9vfuXHBco/EU6kZ00SrM2+HHrFqBpVt9tfW7utg7xH3CEBSfZeBa2a+qrAJpFJqIaYrKOyNo1+LgSoGwFKr6LEGD4SfNeMhbJRLZrepCPJZN25b1YREW7BmOZhZppcRpJoMssWAMIO5iJSfqkkIWkiUY8hEm7hp96Dh5QwL70rWGDAQAWd4NFdi/GcjBGJsDY6mcon1/WzxdU0NHBR/jc3f0MSoJVJ5egofguhNNdjsfRIg9TFAQwHRH3xRz1FMsMDDDX4EX2KECXIKIZEuYiDXOAXg/UgGDXIp4jCL8JMoBRhGqCMa7Vc0L+I0S++Pk1g23dE94UYZS/fMaDwy9wvI97h809OOBNcbqI58oQ7ZoZqt0IRVA63I1ygpOiQOc47PIkvFsoO8AC8SAJp0YKdtMlIeCMN7nMuqIQCqCQnTTJC5GAqxzuwn97e/u7Ct4N83kEhmzXeBSTd1mUltnFu7J/zWSeyKhd0wMj/lWaoyx6GBZkTsJdgyOnMXk5ja2oN90eymlPAVM51btdp |
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 imp | |
import c4d | |
class ImportTester(type): | |
_HaveBeenCalled = False | |
_CanImport = False | |
@classmethod | |
def _CheckImport(cls, clsName): | |
# If we already test, we return the cached value |
OlderNewer