Few import plugin creation questions ...

Hi,

I am writing import plugin for blender but i have encountered some problem and have following questions:

  • Imported model format has tree hiearchy, so i have made blender object tree where each object has its own material (if is same on more objects, is shared across them, texture too) but certain exporter i need to use allows export only one selected mesh. Should i merge all objects in one mesh? Wouldnt be then problem to use vertex animations or bones?

  • How should i create new materials and textures the right way? I use following code, according blender gui is seems that textures & materials are set but when i switch to textured mode, all i see is all-white object. I use following code to manage textures and materials:

node["Material"] = Blender.Material.New(node["Name"])
                    node["Material"].setTexture(0,Blender.Texture.Get(node["Bitmap"]))

                    materials = [node["Material"]]

                    node["Object"].setMaterials(materials)

                    for children in node["Texture Children"]:
                        Blender.Object.Get(children["Name"]).setMaterials([node["Material"]])

and textures

tex = Blender.Texture.New(texture)
        tex.setType("Image")
        tex.image = Blender.Image.Load(texture+".tga")
  • Is there some tutorial how to use bones & IPOs a i must learn on my own? I already have blender api documentation but is bit confusing …