How to Add or find a aov in version 2021(C4D) in python?

Post, discuss and share handy resources like textures, models and HDRI maps in this forum.
Forum rules
Please do not post any material that is copyrighted or restricted from public use in any way. OTOY NZ LTD and it's forum members are not liable for any copyright infringements on material in this forum. Please contact us if this is the case and we will remove the material in question.
Post Reply
WDH
Licensed Customer
Posts: 13
Joined: Mon Aug 29, 2022 7:34 am

@aoktar provide a c++ code , but I know nothing about c++, could some one provide a mini worked python funtions?

Code: Select all

BaseList2D *addAOVnode(BaseList2D *parent, Int32 slotID, Int32 TYPE, Octane::RenderPassId passId, Bool incCnt)
{
    BaseContainer *bc = parent->GetDataInstance();
    Int32 pType = bc->GetInt32(AOV_NODE_TYPE);

    BaseList2D *shd = addOctaneShaderToNode(parent, slotID, ID_OCTANE_AOV_NODE);

    if(TYPE==AOV_TYPE_COMP_GROUP)       {  shd->SetName(AOV_GROUP_NAME);  }
    else if(TYPE==AOV_TYPE_COMP_AOV)         {  shd->SetName(AOV_COMP_NAME);  }
    else if(TYPE==AOV_TYPE_COMP_AOV_LAYER)   {  shd->SetName(AOV_COMPLAYER_NAME);  }
    else if(TYPE==AOV_TYPE_COLOR_OUT)        {  shd->SetName(AOV_COLOROUT_NAME);  }
    else if(TYPE==AOV_TYPE_IMAGE_AOV_OUT)    {  shd->SetName(AOV_IMAGEOUT_NAME);  }
    else if(TYPE==AOV_TYPE_COMP_LIGHTMIXER)  {  shd->SetName(AOV_IMAGEOUT_NAME);  }
    else if(TYPE==AOV_TYPE_RENDER_AOV_OUT)
    {
        shd->SetParameter(DescLevel(AOV_RENDER_PASS_ID), GeData((Int32)passId), DESCFLAGS_SET_0);
        shd->SetName(AOV_RENDEROUT_NAME+S(":[")+Octane::ApiInfo::renderPassName(passId)+"]");
    }

    setParameterLong(*shd, AOV_NODE_TYPE, TYPE);
    if(incCnt)
    {
        Int32 cnt = bc->GetInt32(AOV_INPUT_COUNT);
        setParameterLong(*parent, AOV_INPUT_COUNT, cnt+1);
    }
    return shd;
}
Post Reply

Return to “Resources and Sharing”