[Bf-committers] Access to object during drawing

Campbell Barton ideasman42 at gmail.com
Wed Apr 9 01:40:38 CEST 2014

Rather not expose the Object via the DerivedMesh, having a strict
assurance access only go one-way means we don't have to worry about
nasty stuff like `((Mesh *)dm->ob->data)->mvert` getting into the

But accessing materials seems reasonable from the DerivedMesh, why not
just store a material pointer array and its size there?

On Wed, Apr 9, 2014 at 8:48 AM, Antony Riakiotakis <kalast at gmail.com> wrote:
> Hi,
> For the new code that displays meshes in texture paint for gsoc, I will
> need access to the material at gpu buffer build time. This in turn requires
> access to the object, since the code only has access to the derived mesh.
> Is there some way to get it? I can only see getting this through
> GPUMaterialState but I'm not sure if such a way is nice due to using a
> global variable. I see we also have some other uses of global variables
> such as  Gtexdraw.
> Maybe adding an extra Object pointer to the derived mesh would help here?
> Access to the Object would solve some other nice stuff we have, such as
> allocating MAXMAT arrays on the stack at GPU buffer creation time.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

- Campbell

More information about the Bf-committers mailing list