[Bf-committers] Split Collada into a python frontend and a C++ backend

Brecht Van Lommel brechtvanlommel at pandora.be
Sun May 20 14:37:41 CEST 2012


I don't think it's a good idea to do this. If you want to add more
exporting features, having this done partially in python and partially
in C is going to make things quite complicated, it's going to lead to
code duplication and some quite complex interaction between the python
and C exporter code.

Simply feeding the mesh objects to the collada exporter might seem
simple but I don't think it is, because they are also tied to objects.
You'd need to shuffle around mesh datablocks, adjust modifiers, take
selection into account, etc to make it all work together.

Brecht.

On Sun, May 20, 2012 at 12:47 PM, Gaia <gaia.clary at machinimatrix.org> wrote:
> Hi.
>
> I'd like to propose and offer the implementation of a simple change
> to the Collada module:
>
> * I want to replace the user interface of the Collada module by a
> python based io addon and then simply call the internal Collada
> module from that addon. (I have this addon already finished)
>
> This allow us to enable/disable Collada like all other io modules.
>
> * I want to add the ability to export a collection of Mesh instances
> for special purposes like:
>
> - add target specific checks
> - modify objects to satisfy constraints of the target system
>
> ===================================
> The implementation is straight forward:
> ===================================
>
> - Make the existing COLLADA entries invisible
>
>   I can get them out of the way by removing these lines from
>   wm:operators.c
>
>   #ifdef WITH_COLLADA
>       /* XXX: move these */
>       WM_operatortype_append(WM_OT_collada_export);
>       WM_operatortype_append(WM_OT_collada_import);
>    #endif
>
>   My problem here: When i remove these lines, then i no longer
>   know how i can access the Collada Importer/Exporter
>   from a Python script since the operators are no longer available.
>
> - Create the python based "Blender Collada" addon
>
>   Just for the GUI. The addon does nothing else (at the moment)
>   than calling the Blender importer/exporter (works for me as long
>   as the "official" Collada exporter is also available, see above)
>
> - auto enable the "Blender Collada" addon
>
>   I think this is just done by modifying the default start blend file ?
>
> - Also allow to export Mesh instances instead of Objects:
>
>      Mesh new_mesh = object.to_mesh()
>      # manipulate the new_mesh
>      export it to collada (here we need an access function which
>      allows to feed the collada exporter with Mesh objects from python )
>
> ========
>
> I would only need some help when it comes to defining the
> access functions from Python to the internal Collada module.
> I can do all the rest by myself.
>
> Opinions ?
>
> thanks,
> Gaia
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list