I’m currently experimenting on a livebridge between blender and our studio game engine.
As an experiment, i wanted to write an exporter using C++ that could use the power of the as_pointer() method. Where could i find good example on how this can be done?
I find creating a struct similar to blender object.data ( Mesh struct ) quite challenging. An example would be quite nice!
There is a DNA_mesh_types.h in the source code, and you can cast object.data.as_pointer() to Mesh* for mesh objects. It’s just going to break all the time as it is an internal data structure that frequently changes, it’s not part of the public API.
Are you suggesting that C API users should use each of these individually? o.data.vertices.data.as_pointer() ; o.data.edges.data.as_pointer(); o.data.polygons.data.as_pointer() ; o.data.loops.data.as_pointer() ; o.data.uv_layers.data.as_pointer()
I was thinking that C.object.data.vertices.foreach_get() via numpy was too slow for our project; but getting the memory adress of each Vertex individually seem quite un-productive
I’m sure many game engine developers would appreciate an efficient method to catch a Mesh struct quickly from C
You don’t need to get the address of every vertex individually, a pointer to the first element is a pointer to the entire array.
Cycles seems being able to read whole depsgraph data
i see depsgraph.as_pointer() in Cycles addon source. And other Render engines need to loop over each objects, and each Loops/Edges/Polys/Verts/Uv’s ect… that seem slow (and a bit unfair )
Thank you, will take a look
Curious about this luxcore approach
While re-using/linking our code for your own purposes is perfectly OK and highly encouraged, the GPL license attached to some of these files cannot be removed. You seem to have accidentally removed the GPL license header from buildinfo.c which is present in the original copy