[Bf-python] a direct x importer addon for 2.6x (armature support)

Campbell Barton ideasman42 at gmail.com
Thu Dec 29 00:43:08 CET 2011


Hi, I had a look over the script and think its mostly ok but still
some things I think should be resolved.

the obvious issues are still with namespace. from checking:
littleneo-directX_blender-a3ed6b4

these lines assume an image filename can fit into an ID name which may
well fail if the names over 22 chars.
if filename not in bpy.data.images :
if filename not in bpy.data.textures :

suggest to have a dictionary which maps names to datablocks.
if its desireable to use existing datablocks this dict could
optionally be initialized from existing data when the import starts.

Another is...
 bpy.ops.object.select_name(name=arm.name)

This should be replaces with...
 arm.select = True
 bpy.context.scene.objects.active = arm


Since the script looks quite well written (aside from noted issues) -
suggest this go into contrib/ so users can start testing more easily
and the few remaining issues can be resolved.

On Tue, Dec 27, 2011 at 7:42 AM, jerome <jerome.le.chat at free.fr> wrote:
> hi,
>
> the .x file importer has now support for armatures and parent-childs
> relationships importation.
> download and info :
> https://github.com/littleneo/directX_blender/wiki
>
> you need to enable the 'experimental blah' checkbox in the importer
> options for armatures/empties, and relation-ship importation.
> once the script has finished its job, mesh objects need to be parented
> 'by hand' using alt-p > Armature Deform or an Armature modifier.
> (vertices weights are ready)
>
> Campbell please let me know for naming convention, it's ok according to me.
> Thanks for feedback and .x files you'd like to share to improve this.
>
> wish you the best,
>
> Jerome
>
>
> Le 30/11/2011 01:06, jerome a écrit :
>> Le 25/11/2011 05:16, Campbell Barton a écrit :
>>> On Thu, Nov 24, 2011 at 6:52 PM, jerome<jerome.le.chat at free.fr>  wrote:
>>>> oh ok Campbell,
>>>>
>>>> this should be alright then, at least for objs, meshes and mats. (tex
>>>> slots / img not supported yet but will be)
>>>> I though you talked about python module namespaces, 'import / from bpy
>>>> import' etc stuffs :)
>>>>
>>>> bpy.data.materials.new(name="MyMat").name = name
>>>> :)
>>>>
>>>> J.
>>> see found a way around but its not foolproof.
>>>
>>> you might still exceed the name length or have a blank script - see:
>>> http://www.blender.org/documentation/blender_python_api_2_60_5/info_gotcha.html#naming-limitations
>>>
>>> _______________________________________________
>>> Bf-python mailing list
>>> Bf-python at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-python
>>>
>>>
>> oh the bpy.data.materia... line was just a kind of joke, you can find
>> the naming function quickly. assuming the name max lenght is 21 this
>> should be ok (actually 17 + 4 digits maybe a bit paranoid..).
>>
>> sorry I was not very available these days and won't until the next week.
>> nice pointer btw thanks.
>>
>> Jerome
>>
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python



-- 
- Campbell



More information about the Bf-python mailing list