McManning / Coherence

Blender viewport renderer using the Unity Engine
MIT License
30 stars 0 forks source link

Add custom vertex data support for third party plugins #38

Open McManning opened 3 years ago

McManning commented 3 years ago

Current API is specced as the following for Plugin:

    def add_custom_vertex_data_stream(self, id: str, size: int, callback):
        """
        Add a callback to be executed every time vertex data needs to be synced.
        The callback must return a pointer to the custom vertex data, aligned *to loops*
        for the given mesh.

        `def callback(mesh: bpy.types.Mesh) -> ctypes.void_p`

        Args:
            id (str):
            size (int):             Number of bytes in the data stream per loop index
            callback (callable):    Callable that returns a pointer to the data stream
        """
        pass

    def remove_custom_vertex_data_stream(self, id: str):
        """Remove a previously registered vertex data stream

        Args:
            id (str):
        """
        pass

Few thoughts: