Skip to content

Instantly share code, notes, and snippets.

View NiklasRosenstein's full-sized avatar
💭
I may be slow to respond.

Niklas Rosenstein NiklasRosenstein

💭
I may be slow to respond.
View GitHub Profile
@NiklasRosenstein
NiklasRosenstein / c4dpytask-3.py
Created September 19, 2013 12:47
@rosensteinn #c4dpytask Remove all empty texture tags on the Scene? Share it if you have a solution!
# @rosensteinn #c4dpytask Remove all empty texture tags on the Scene?
# Share it if you have a solution!
import c4d
def iter_hierarchy(op):
# Iterate over each tag of the current object.
for tag in op.GetTags():
# Check if the tag is a texture tag, and if it is, if it has
#!/bin/bash
set -euo pipefail
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
( wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg >/dev/null )
gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
#!/bin/bash
# https://github.com/weaveworks/ignite/blob/main/docs/installation.md
set -euo pipefail
DEFAULT_CNI_VERSION=v0.9.1
DEFAULT_IGNITE_VERSION=v0.10.0
function main() {
ident = 5159
import c4d
print "************"*4
print "Results for", ident
for key, value in vars(c4d).iteritems():
if value == ident:
print(key)
# Copyright (C) 2015 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@NiklasRosenstein
NiklasRosenstein / recover-scene.py
Last active March 20, 2022 06:12
This script imports a Cinema 4D scenefile and disables all deformers, generators and expressions. This is useful if the scene was saved at a state it is unrecoverable because of an issue while scripting (eg. saved the scene before a Python tag was executed, but now that Python tag always runs in an # infinite loop).
# Copyright (c) 2013, Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# 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\
# Example of using the Cinema 4D Tree View GUI in Python.
import c4d
import os
import weakref
# Be sure to use a unique ID obtained from http://www.plugincafe.com/.
PLUGIN_ID = 9912399
PLUGIN_NAME = "Python TreeView Example"
PLUGIN_HELP = "Show the current scene hierarchy in a tree."
import string
import random
DEFAULT_POOLS = [
string.ascii_lowercase,
string.ascii_uppercase,
string.digits,
'_!@$'
]
@NiklasRosenstein
NiklasRosenstein / c4d_skeleton.pyp
Created June 13, 2015 13:51
Cinema 4D skeleton plugin.
# Copyright (C) <year> <name>
# All rights reserved.
#
# \\file <filename>
# \\lastmodified <date>
# \\brief <description>
import c4d
import os