> In a SourceGeo, if I'm creating multiple objects, where would be the place to 
> assign a matrix to each object/GeoInfo?
> 
> If I do it in create_geometry(), the matrix for each object is reset to the 
> identity. I suppose this is happening in init_geoinfo_parms() ?

Correct, use init_geoinfo_parms().

Here's a snippet from a previous email talking about this ("New method in 
SourceGeo?") and showing what you need to set on the GeoInfo:

Matrix4 m_local;  // Local matrix that Axis_Knob sets


/* Copy the local matrix to all objects, and assign all
    the other global geoinfo parameters.
*/
MySourceGeo::init_geoinfo_parms(Scene& scene, GeometryList& out) {
    const unsigned nObjects = out.size();
    for (unsigned i=0; i < nObjects; ++i) {
        GeoInfo& info = out[i];
        info.matrix      = m_local; //<< Set to identity in base class 
implementation
        info.material    = input_iop();
#if kDDImageVersionInteger >= 63100
        info.materialContext = outputContext(); // << only for 6.3+
#endif
        //
        info.render_mode = render_mode_;
        info.display3d   = display3d_;
        info.selectable  = selectable();
        info.selected    = false;
        //
        info.source_geo  = 0;
        info.select_geo  = (selectable())?this:0;
        info.recursion_geo = 0;
    }
}



> Option 1 seems the easiest, and it's what I had until now, but I'm curious to 
> know if there's any benefits from setting a geoinfo matrix vs baking it into 
> each point. Is either of them better in terms of performance?

Depends on how often the points are being read, but generally setting the 
matrix is much faster as OpenGL uses it to display the points.  They don't need 
to be actually transformed until they're either processed or rendered, and 
other code will care of that for you.


-jonathan

_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to