Topic: Export Deform bones only

Using the Blender export addon, is there a way to restrict the export to Deform bones only?

Re: Export Deform bones only

As there are a few other details that I'd like to tweak/customize, I'll modify the exporter and submit an alternative version if someone is interested.

Last edited by com3D (2013-08-09 17:01:13)

Re: Export Deform bones only

I have to say that I don't understand what you mean by "restrict  the export to Deform bones only"
can you give a clear example ?

Re: Export Deform bones only

Sorry Anaël,

What I want to achieve is something similar to the collada and fbx export panel which allow to check a "Deform Bones only" option.

See Blender Collada Export for example.

This option is really interesting when you are using an advanced rig to easily pose your mesh or if you're using additional bones to create shape keys.

This is the "use_deform" boolean parameter in the Blender API.

Additionaly, I want the script :
    - not to write animation frames that are not set in the "Maratis Anims" from Blender Properties/Render panel
    - not to write scale values in the maa file if these values remain constant
    - to write the texture filename in the mesh file formated in this way : "../maps/filename" instead of "filename with path"
    - to export the textures in the maps folder of the project

Last edited by com3D (2013-08-10 08:09:47)

Re: Export Deform bones only

that seems good.

- yes good idea (with an option you can un-check if possible)

- I agree, I tried to not export similar keyframes in a row but it still misses optimization like the
one you suggest.

- texture filename are made local like this "../maps/filename"
if you export the mesh in your-project/meshs/ path when your textures are already in your-project/maps/ path

- but yes a "copy maps" option can be useful if the textures are not in the good place,
it should just give a warning that if there is already textures in the maps folder with the same name it can be lost.

If you are interested (and if you have time), there is other improvements I had in mind
that I never had time to do, would you want to hear ?

Re: Export Deform bones only

Yes, I am open to any suggestion.

I know you're really busy, so even if I'm totally noob to python and blender scripting, I'll try to implement all that I can.

Currently, I've successfully implemented the first 3 features, with an option for Deform bones.

What I'll try next is to give the ability to rename the anims and reorder them (move them up/down in the stack).
These names would then be written in the mesh file.

Another option could be to allow rescaling at export.

What else ?

Re: Export Deform bones only


the idea is to create a menu to handle multiple meshs and their respective options and anim ranges,
so if a blender scene contains multiple "future" Maratis meshs, you don't have to select it each time.

Right now the menu is like that :

The idea is to do :

- it will need an additional option to center the mesh at export

I think it's something that would help manage data between Blender and Maratis,
but it's not a vital feature, and it's work, so you see if you are interested, no problem.

Re: Export Deform bones only

I have to get more familiar with panels before trying this one !

Currently I'm struggling with the anims panel.


I've added a field using:

layout.prop(list_item.my_item, 'name')

but I can't figure out how to update the anims' names in the stack.

Do you know how to achieve this and/or can you point me to good and up-to-date tutorials, ressources, snipets...

Re: Export Deform bones only

ok, no stress.

I think you can change the name by doing :
mar_anim_list[id].name = newName

Re: Export Deform bones only

Where? In draw?

Re: Export Deform bones only

No, when the field you added is modified :
see "Update Example" there … props.html
(when you create your StringProperty, add : update=update_func)

and in your custom "update_func" do something like :

sce = context.scene
id = sce.mar_anim_list_index
mar_anim_list = sce.mar_anim_list
mar_anim_list[id].name = mar_anim_list[id]

Re: Export Deform bones only

Many thanks, I've made some progress and things are clearer now.
I wrongly understood that values were updated each time the panel is drawn.

I've used :
    bpy.types.Scene.my_string_prop = bpy.props.StringProperty(name = "Rename", update=update_func)
to create my StringProperty

Now, in draw, if I use :
    layout.prop(sce, 'my_string_prop')
Anims in the stack are updated, but I can't retrieve the values from the stack into my_string_prop field (which is static) when I click on the anims.

And if I use :
    layout.prop(list_item.my_item, 'name')
I can retrieve the value from name when I click on the anims, but how can I call the update function as my_string_prop hasn't updated ?
Is there a way to assign a StringProperty to 'name' ? ( doesn't work).
I'm sure I'm missing something evident.

Last edited by com3D (2013-08-11 12:54:00)

Re: Export Deform bones only

I don't think you should create "bpy.types.Scene.my_string_prop" in the scene,

look at "" how AnimListItem.loops is made,
it's there I think you should add the new property so it's attached to AnimListItem.

Something like : = StringProperty(
        name= "name",
        description= "anim's name",

after AnimListItem.loops = ... in ""

Re: Export Deform bones only

Wow! Works perfectly! tongue

I've put the update_funct just before "def register():" in
It works, but is it correct?

Last edited by com3D (2013-08-11 14:08:15)

Re: Export Deform bones only

"See Blender Collada Export for example."
in Blender > Export > Collada (default) (.dae)
the export options window does not appear

Re: Export Deform bones only

Does it appear with other exports, for example wavefront obj ?

Re: Export Deform bones only


Re: Export Deform bones only

The export panel is located at the bottom-left side of the workspace once you've clicked File > Export > Collada.
You might need to move the scrollbar down if you can't see it.