How to get octane aov manager in python
-
hello there!
I want to get every attribute in octane aov manager in python, but I don't know the way, can you help me? Thank you๏ผ
-
Hei @render_exe !
First of all , I think Octane is out of supports in cafe , you should connect to otoy ( but I think that is a not a good conversation experience and you mostly get no feedback) Octane refuse to provide any sdk as I know , I don't know why that happened
But as this question , I have an octane api helper, here is a little example to read aov data of octane, hope it helps
Note: I delete somesubdata
conditions for read. but it is all likeZ-Depth
aov.Cheers~
from typing import Optional import c4d from dataclasses import dataclass from pprint import pprint # Octane render ID_OCTANE_VIDEO_POST = 1029525 SET_RENDERAOV_IN_CNT=3700 SET_RENDERAOV_INPUT_0=3740 VP_COLOR_SPACE = 1028 # RenderPassAOV_h RNDAOV_NAME=900 RNDAOV_ENABLED=994 RNDAOV_TYPE=995 RNDAOV_TYPE_NAME=1101 RNDAOV_ZDEPTH=255 RNDAOV_ZDEPTH_MAX=3392 RNDAOV_ZDEPTH_ENVDEPTH=3397 @dataclass class OctaneAOVData: aov_shader: c4d.BaseShader aov_enabled: bool aov_name: str aov_type: int aov_subdata: list class OctaneVideoPostHelper: def __init__(self): self.vp: c4d.documents.BaseVideoPost = self.get_videopost(doc) def get_videopost(self, doc: c4d.documents.BaseDocument) -> c4d.documents.BaseVideoPost: """Get the Octane video post""" rdata: c4d.documents.RenderData = doc.GetActiveRenderData() vpost: c4d.documents.BaseVideoPost = rdata.GetFirstVideoPost() octVp: c4d.documents.BaseVideoPost = None # ่ทๅOctane VP while vpost: print(vpost.GetType()) if vpost.GetType() == ID_OCTANE_VIDEO_POST: octVp = vpost vpost = vpost.GetNext() return octVp def list_vpdata(self): if self.vp is None: raise RuntimeError("Can't get the Octane VideoPost") bc: c4d.BaseContainer = self.vp.GetDataInstance() for key in range(len(bc)): key = bc.GetIndexId(key) try: print(f"Key: {key}, Value: {bc[key]}, DataType{bc.GetType(key)}") except AttributeError: print("Entry:{0} is DataType {1} and can't be printed in Python".format(key, bc.GetType(key))) def read_aov(self) -> list[OctaneAOVData]: if self.vp is None: raise RuntimeError("Can't get the Octane VideoPost") aovCnt = self.vp[SET_RENDERAOV_IN_CNT] print ("--- OCTANERENDER ---") print ("Name:", self.vp.GetName()) print ("Color space:", self.vp[VP_COLOR_SPACE]) print ("AOV count:", aovCnt) print ("--- OCTANERENDER ---") aovs: list[OctaneAOVData] = [] for i in range(0, aovCnt): aov = self.vp[SET_RENDERAOV_INPUT_0+i] aov_enabled = aov[RNDAOV_ENABLED] aov_name = aov[RNDAOV_NAME] aov_type = aov[RNDAOV_TYPE] aov_subdata = None # Z-Depth if aov_type == RNDAOV_ZDEPTH: aov_subdata = [ aov[RNDAOV_ZDEPTH_MAX], aov[RNDAOV_ZDEPTH_ENVDEPTH] ] print ("Subdata: Z-depth max:",aov[RNDAOV_ZDEPTH_MAX]," Env.depth:",aov[RNDAOV_ZDEPTH_ENVDEPTH]) aovs.append(OctaneAOVData(aov_shader=aov, aov_enabled=aov_enabled, aov_name=aov_name, aov_type=aov_type, aov_subdata=aov_subdata)) return aovs # Execute if __name__=='__main__': oc = OctaneVideoPostHelper() pprint(oc.read_aov())
-
@Dunhou said in How to get octane aov manager in python:
First of all , I think Octane is out of supports in cafe , you should connect to otoy ( but I think that is a not a good conversation experience and you mostly get no feedback) Octane refuse to provide any sdk as I know , I don't know why that happened
I've managed to get help from Aoktar in the forum, but you have to be persistent and kinda spam the post every two weeks haha.
One question, since i'm trying to do the same; build some automation with C4D/Octane/Redshift, is your Octane api helper available anywhere ? I'm stuck on a few topics like AOV and the BaseContainer options
-
@Tng Yeah, you are right, you must send more than 3 and get one feedback , and wait for a loooooooong time.
And yes , I would make it open source once it is done ( at least a basic structure ), but it is a habit thing to me so not enough times always. I have a redshift api on github. but with octane , it has so many problems , octane don't use xppresso or node editor but a custom userarea and refuse to provide any sdk , you can't even get a selected node. but anyway , I have a bare-bone one now , it worked with light material aov and somethings else . but I don't know how long it will takes me( consider I have some artworks to do and some plugins development plan before it ).
Cheers~
-
@Dunhou Thank you, I will read and test the code, thank you.
Cheers~ -
@Dunhou I know about your redshift api that's why i asked about octane since i didn't find it on your github Would you be open to collaboration on the Octane API ? Here is my discord if you wanna talk about it : ShivaMist#8262
-
-
Hello @render_exe,
Thank you for reaching out to us. Unfortunately, as already pointed out by @Dunhou, questions about third party APIs are out of scope of support:
Forum Guidelines: Scope of Support
We cannot provide support on learning either C++, Python or one of its popular third party libraries.
Thank you @Dunhou for providing such a nice community answer. Since this topic is not about the Cinema 4D SDK, I have moved it to General Talk.
Cheers,
Ferdinand