python and settings
Moderators: ChrisHekman, aoktar
Are you happy to see a little c++ code?
Octane For Cinema 4D developer / 3d generalist
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw

Ok, sorry. All settings is on a object. Which is named "myOctaneSettings" and hidden.
You can find it and get BaseContainer. code is "BaseContainer *bc = paramObject->GetDataInstance()" Which is similar in phyton.
You should know all parameters with Id and types also. I can post a c++ to see this parameters. like this
Code: Select all
/// --------------- DirectLighting Kernel---------------
DlGIMod = bc->GetLong( SET_DIRECT_GIMOD, 4);
DLAODist = (float) bc->GetReal(SET_DIRECT_AODIST, 5.0);
DlMaxSamples = bc->GetLong( SET_DIRECT_MAXSAMPLES, 128);
DlDifDepth = bc->GetLong( SET_DIRECT_DIFDEPTH, 2);
DlGlosDepth = bc->GetLong( SET_DIRECT_GLOSDEPTH, 2);
DlFsize = (float) bc->GetReal( SET_DIRECT_FSIZE, 1.2);
Octane For Cinema 4D developer / 3d generalist
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
- LudovicRouy
- Posts: 216
- Joined: Sat Apr 03, 2010 5:05 pm
- Location: FRANCE
- Contact:
Here is a script to put in a python script tag (sorry I don't know how to force indentation in post replace * by tab):
import c4d
def main():
* op[c4d.EXPRESSION_ENABLE]=0
* octSet = 0
* oLst = doc.GetObjects()
* for i in oLst :
** if i.GetName()=="myOctaneSettings":
*** octSet = i.GetDataInstance()
* if octSet :
** print " GI mode : " + str(octSet[c4d.SET_DIRECT_GIMOD])
** print " AO distance : " + str(octSet[c4d.SET_DIRECT_AODIST])
** print " Max samples : " + str(octSet[c4d.SET_DIRECT_MAXSAMPLES])
** print " Diffuse depth : " + str(octSet[c4d.SET_DIRECT_DIFDEPTH])
** print " Glossy depth : " + str(octSet[c4d.SET_DIRECT_GLOSDEPTH])
** print " Filter size : " + str(octSet[c4d.SET_DIRECT_FSIZE])
Hope this will help other python coders
Thanks to Ahmet and his c++ settings
import c4d
def main():
* op[c4d.EXPRESSION_ENABLE]=0
* octSet = 0
* oLst = doc.GetObjects()
* for i in oLst :
** if i.GetName()=="myOctaneSettings":
*** octSet = i.GetDataInstance()
* if octSet :
** print " GI mode : " + str(octSet[c4d.SET_DIRECT_GIMOD])
** print " AO distance : " + str(octSet[c4d.SET_DIRECT_AODIST])
** print " Max samples : " + str(octSet[c4d.SET_DIRECT_MAXSAMPLES])
** print " Diffuse depth : " + str(octSet[c4d.SET_DIRECT_DIFDEPTH])
** print " Glossy depth : " + str(octSet[c4d.SET_DIRECT_GLOSDEPTH])
** print " Filter size : " + str(octSet[c4d.SET_DIRECT_FSIZE])
Hope this will help other python coders
Thanks to Ahmet and his c++ settings

Good script. Thanks.LudovicRouy wrote:Here is a script to put in a python script tag (sorry I don't know how to force indentation in post replace * by tab):
But when I write my own value to settings like: octSet[c4d.SET_DIRECT_MAXSAMPLES]=2000.0
setting changes but in Octane Settings window nothing happens and c4d.EventAdd() useless
- LudovicRouy
- Posts: 216
- Joined: Sat Apr 03, 2010 5:05 pm
- Location: FRANCE
- Contact:
Yes, i didn't know how to update the settings window
BUT if you close it, execute your script then reopen it, you'll see that settings are changed and updated.
Or as you know the keys you can close the window run your script and just use the print statement to verify updates.
Please Ahmet could you post other c++ settings ?
BUT if you close it, execute your script then reopen it, you'll see that settings are changed and updated.
Or as you know the keys you can close the window run your script and just use the print statement to verify updates.
Please Ahmet could you post other c++ settings ?
All command is in txt file. I don't know a way to force updates on external dialog.But IDD_SETTINGS_DIALOG is id for settings dialog. Also you can see all values in "vprender.h" and "c4d_symbols.h".
Setting ID's are also same on Octane render settings.
Setting ID's are also same on Octane render settings.
- Attachments
-
- settings.txt
- (6.2 KiB) Downloaded 489 times
Octane For Cinema 4D developer / 3d generalist
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
- LudovicRouy
- Posts: 216
- Joined: Sat Apr 03, 2010 5:05 pm
- Location: FRANCE
- Contact:
Thanks Ahmet,
Its a good starting point
Its a good starting point
