==== Octane useful scripts ====

Sub forum for help and tutorials.

Moderators: aoktar, ChrisHekman

HSchoenberger
Licensed Customer
Posts: 6
Joined: Tue Jan 23, 2024 10:16 am

aoktar wrote:I don't understand your request. You have two different point to read numbers, current plugin version or saved version number in to scene. What do you want to get exactly if scene version number overwritten?
>You have two different point to read numbers
There is only one.
If you take a look at the script, it retrieves the version from the scene:
bc = doc[ID_OCTANE_LIVEPLUGIN]
print ("Octane version=",bc[c4d.SET_OCTANE_VERSION])

And I need the version number of the plugin currently loaded in C4D.
User avatar
aoktar
Octane Plugin Developer
Posts: 16063
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye
Contact:

HSchoenberger wrote:
aoktar wrote:I don't understand your request. You have two different point to read numbers, current plugin version or saved version number in to scene. What do you want to get exactly if scene version number overwritten?
>You have two different point to read numbers
There is only one.
If you take a look at the script, it retrieves the version from the scene:
bc = doc[ID_OCTANE_LIVEPLUGIN]
print ("Octane version=",bc[c4d.SET_OCTANE_VERSION])

And I need the version number of the plugin currently loaded in C4D.
It's another info published a few page back
viewtopic.php?f=87&t=56039&start=30#p422511
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
HSchoenberger
Licensed Customer
Posts: 6
Joined: Tue Jan 23, 2024 10:16 am

aoktar wrote: It's another info published a few page back
viewtopic.php?f=87&t=56039&start=30#p422511
If I follow your link, then I see the same script you already mentioned.
It does not work.
It reads the version from the document.

You are referring to this script, right?

Code: Select all

ID_OCTANE_LIVEPLUGIN = 1029499
def main():
    bc = doc[ID_OCTANE_LIVEPLUGIN] 
    data = c4d.plugins.GetWorldPluginData(ID_OCTANE_LIVEPLUGIN)
    print("data",data[13])  #OPENGL_SAMPLES
    print("data",data[85])  #PREFS_LOCALDB_PATH
    print("data",data[70])  #PREFS_NG_CAT_MAT_COLOR
   
    octPrefs = data[131]
    print("OCIO_USEOTHERCFG:",octPrefs[5])  #OCIO_USEOTHERCFG
    print("OCIO_INTERM_GUESS:",octPrefs[7])  #OCIO_INTERM_GUESS
    print("OCIO_CFG_FILE:",octPrefs[1])  #OCIO_CFG_FILE
   
   
    print ("Octane version=",bc[30])     
    print ("Octane version=",bc[c4d.SET_OCTANE_VERSION])
    print ("Lock resolution=", bc[c4d.SET_LOCKRES])
    print ("Check camera updates=", bc[c4d.SET_CHECK_CAMERA])
    print ("Default environment color=", bc[c4d.SET_DEF_ENV_COLOR])

    print ("Kernel tip=", bc[c4d.SET_KERNEL_TYPE])
    print ("DL Max samples=", bc[c4d.SET_DIRECT_MAXSAMPLES])
    print ("PT Max samples=", bc[c4d.SET_PATHTRACE_MAXSAMPLES])
User avatar
aoktar
Octane Plugin Developer
Posts: 16063
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye
Contact:

HSchoenberger wrote:
aoktar wrote: It's another info published a few page back
viewtopic.php?f=87&t=56039&start=30#p422511
If I follow your link, then I see the same script you already mentioned.
It does not work.
It reads the version from the document.

You are referring to this script, right?
Sorry try this

Code: Select all

    
data = c4d.plugins.GetWorldPluginData(1031195)
print("version",data[5001]) 
print("number",data[5000]) 
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
HSchoenberger
Licensed Customer
Posts: 6
Joined: Tue Jan 23, 2024 10:16 am

Thanks, that works
mili123
Licensed Customer
Posts: 4
Joined: Mon Apr 19, 2021 5:53 am

import c4d
from c4d import gui

ID_OCTANE_LIVEPLUGIN = 1029499
ID_OCTANE_CAMERATAG = 1029524

def main():
doc = c4d.documents.GetActiveDocument()
sBC = doc.GetDataInstance()
data = sBC.GetContainerInstance(ID_OCTANE_LIVEPLUGIN)
p_data = c4d.plugins.GetWorldPluginData(ID_OCTANE_LIVEPLUGIN)

if data:
data.SetFloat(c4d.SET_KERNEL_TYPE, 2)
data.SetFloat(c4d.SET_PATHTRACE_MAXSAMPLES, 1500)
data.SetFloat(c4d.SET_PATHTRACE_GICLAMP, 10)
data.SetFloat(c4d.SET_PATHTRACE_ADAPTIVE_SAMPLING, 1)

if p_data is not None:
p_data.SetFloat(62, 150)
p_data.SetFloat(144, 0)

c4d.EventAdd()
doc.SetChanged()

if __name__=='__main__':
main()

The value of date can be updated. How to update the modified content of p_data to the interface?
W_RTF
Licensed Customer
Posts: 16
Joined: Mon Apr 20, 2020 1:57 am

Request a script to turn octane material preview on or off

I am a Python beginner, where can I find the octane api, can anyone give me some Pointers
Attachments
Snipaste_2025-01-10_16-49-58.png
User avatar
aoktar
Octane Plugin Developer
Posts: 16063
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye
Contact:

W_RTF wrote:Request a script to turn octane material preview on or off

I am a Python beginner, where can I find the octane api, can anyone give me some Pointers
There are not an Octane API to use. All access are done by using data containers by using parameter IDs. These parameters are not accessible by any data, internal to software.
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
W_RTF
Licensed Customer
Posts: 16
Joined: Mon Apr 20, 2020 1:57 am

aoktar wrote:
W_RTF wrote:Request a script to turn octane material preview on or off

I am a Python beginner, where can I find the octane api, can anyone give me some Pointers
There are not an Octane API to use. All access are done by using data containers by using parameter IDs. These parameters are not accessible by any data, internal to software.
Thanks for your reply, mainly when adjusting the material, rendering the material ball will cause IPR slow, so I want to write such a script
User avatar
aoktar
Octane Plugin Developer
Posts: 16063
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye
Contact:

W_RTF wrote: Thanks for your reply, mainly when adjusting the material, rendering the material ball will cause IPR slow, so I want to write such a script
What's the advantage of it over manually switch off from menu?
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
Post Reply

Return to “Help / Tutorials”