[Sidefx-houdini-list] Mantra procedural question

Peter Baldwin peter_and_emily at ntlworld.com
Tue Aug 21 09:50:28 EDT 2007


Have you tried creating a sub-procedural within your principal proc's 
main render method? Something like:

class VRAY_myProc : public VRAY_Procedural {
...
}
class VRAY_mySubProc : public VRAY_Procedural {
...
}

VRAY_Procedural *allocProcedural(const char * string_in){
    if(!strcmp(&string_in[0],"myProc")){
        return new VRAY_myProc();
    }
    if(!strcmp(&string_in[0],"mySubProc")){
        return new VRAY_mySubProc();
    }
}

void VRAY_myProc::render(float /*lod*/){
    openProceduralObject();
    // new sub procedural
    VRAY_Procedural *pushNEW=allocProcedural("mySubProc");
    VRAY_mySubProc *pushON=(VRAY_mySubProc*)pushNEW;

        // fill out geo stuff and bbox in pushON....

        addProcedural(pushON);
        closeObject();
}

This might clean up after itself better...

Peter



Fred Valleur wrote:
> Hi Peter,
>
> yes, that's exactly what I want to do. Unfortunately it's unclear (at least
> to me) how to run the procedural memory allocation/desallocation on a "per
> bucket" basis.
> My first (and bit too optimistic) thought was that it was the procedural's
> default behavior.
> It seems that something more specific needs to be done for Mantra to flush
> the memory allocated for a previous bucket.
>
>      Cheers,
>      Frederic.
>
>
> On 8/21/07, Peter Bowmar <pbowmar at gmail.com> wrote:
>   
>> I'm pretty sure there is a way to do it, I just don't know how right
>> now... I believe what you want to do (Mark or Andrew, correct me if
>> I'm wrong) is to run a new "procedural object" for each bucket Mantra
>> renders, so when the bucket is done, the object is deleted along with
>> any malloc()s it made. I could be way off here though... As it
>> happens, this is something we'll be doing in the next few weeks so I
>> may have better info then :)
>>
>> Cheers,
>>
>> Peter B
>>
>>     
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>
>   




More information about the Sidefx-houdini-list mailing list