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
# 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 |
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
# 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 |
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
# @rosensteinn #c4dpytask | |
# | |
# How can you position the selected objects at the world origin? | |
import c4d | |
def main(): | |
# Retrieve a list of all selected objects in the scene | |
# and iterate over them. | |
objects = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_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
# @rosensteinn #c4dpytask #medium How can you load a texture and assign | |
# it to a plane with image dimensions? (you need a LoadDialog, BaseBitmap | |
# and Oplane) | |
import c4d | |
def main(): | |
# Poll the user for a filename. We specify that the file-type may be | |
# an image only. | |
filename = c4d.storage.LoadDialog(c4d.FILESELECTTYPE_IMAGES) |
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
# @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 |
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(): | |
# Retrieve the document settings. | |
bc = doc.GetSettingsInstance(c4d.DOCUMENTSETTINGS_DOCUMENT) | |
# Retrieve the current bitmask for the states of the selection filters. | |
flags = bc.GetLong(c4d.DOCUMENT_SELECTIONFILTER) |
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
# @rosensteinn #c4dpytask #beginner How can you apply a Cinema 4D | |
# command to each selected object individually? | |
import c4d | |
# The ID of the Command which should be executed for each object. | |
# In this case, I chose the "Group Objects" command. | |
COMMAND_ID = 100004772 | |
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
# 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 |
OlderNewer