Corona Renderer Forum

Corona Renderer for Cinema 4D => [C4D] I need help! => Topic started by: JPeters on 2021-08-25, 16:17:44

Title: Python commands to create Corona lights/cameras etc.
Post by: JPeters on 2021-08-25, 16:17:44
Hi guys,

Just a quick question, is there a list or page somewhere that lists the proper Python commands to create Corona lights or cameras etc.?

With "proper" I mean not "c4d.CallCommand(1032104) # Corona Light" but rather something along the lines of "c4d.BaseObject(c4d.Ocamera)"

Thanks!
Title: Re: Python commands to create Corona lights/cameras etc.
Post by: mmarcotic on 2021-08-26, 15:56:46
Hello,

since our objects are not part of the c4d module, there will not be any c4d.Ocoronalight, however, you can substitute
Code: [Select]
c4d.CallCommand(1032104) with
Code: [Select]
doc.insertObject(c4d.BaseObject(1032104))
Additionally, Corona Camera is a tag and not an object, so you should follow the syntax of creating a camera and then adding a Corona Camera Tag (1032177)

Jan
Title: Re: Python commands to create Corona lights/cameras etc.
Post by: JPeters on 2021-08-27, 09:47:04
Hi Jan,

This is very helpful, thank you!

Now I can create the objects in memory first, name them etc. and then insert them in the hierarchy like a normal C4D object.

You can't do this with the "c4d.CallCommand" syntax since it just creates the object in the root of the scene.

Cheers,