Hello @Ryan_Territory,
Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:
Support Procedures: Scope of Support: Lines out the things we will do and what we will not do.
Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon.
Forum Structure and Features: Lines out how the forum works.
Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner.
About your First Question
This exact question of yours has been asked before here for C++. Find a Python variant of the code below. For the technical details, I would recommend reading the older thread.
Cheers,
Ferdinand
Result:
557e9ddd-793a-4d07-aa6e-5ffd7ad05687-image.png
Code:
import c4d
# Define #Orslight, only must be done in pre 2023.0 API versions.
c4d.Orslight: int = 1036751
def main():
doc = c4d.documents.GetActiveDocument()
# Create Light
light = c4d.BaseObject(c4d.Orslight)
# Set the attributes
light[c4d.REDSHIFT_LIGHT_TYPE] = c4d.REDSHIFT_LIGHT_TYPE_DOME
# Define the texture parameter ID.
texturePathId: c4d.DescID = c4d.DescID(
# 1st DescLevel for the outer unexposed datatype of "Texture".
c4d.DescLevel(
c4d.REDSHIFT_LIGHT_DOME_TEX0, # The parameter ID (12000) for "Texture"
1036765, # The datatype ID for for "Texture", this type is not exposed,
# we must use the raw ID.
c4d.Orslight # The creator ID, Orslight in this case.
),
# 2nd DescLevel for the inner exposed datatype of "Texture.Path".
c4d.DescLevel(
c4d.REDSHIFT_FILE_PATH, # The sub-channel parameter ID (1000) for "Texture.Path"
c4d.DTYPE_STRING, # The data type ID of this component, string in this case.
0 # The creator ID, I just went with undefined here.
))
light[texturePathId] = "asset:///file_c622e9ad3ea0e159"
# Insert the light into the scene
doc.InsertObject(light)
c4d.EventAdd()
if __name__=='__main__':
main()