Commit Graph

45 Commits

Author SHA1 Message Date
Arystanbek Dyussenov
d06eb49b2f COLLADA importer: basic armature import.
Since in DAE only a matrix is stored per bone, some tricks have to be applied to build an armature from it:
- direction for "leaf" bones is hard-coded to Y vector. This will be changed to bone matrix orientation, somehow code will need to 
  derive the bone "forward" axis
- for "leaf" bones length cannot be determined, currently it is hard-coded (second screenshot), but I think changing it to the average 
  length of all non-leaf bones is ok
- parent bones get their tail at last child's head, this is not good (first screenshot). For bones with more than one child Chingiz 
  suggested not to link it with any child, I think it's a good idea. Length will be the same as for leaf bones.

Screenshots: 
http://img232.imageshack.us/img232/8905/screenfhy.png
http://img406.imageshack.us/img406/3004/tobaggan.png
2009-07-25 16:10:17 +00:00
Chingiz Dyussenov
d6098931dd Another fix to textures import. 2009-07-25 15:12:56 +00:00
Chingiz Dyussenov
97837623a7 Fixed textures, images import/export. 2009-07-25 14:09:15 +00:00
Chingiz Dyussenov
9603fd2289 If <geometry> is instaciated through <controller>, it will be imported. 2009-07-23 11:48:31 +00:00
Arystanbek Dyussenov
3b058378dd Importer: fix parenting. 2009-07-22 03:51:11 +00:00
Arystanbek Dyussenov
e62b675858 Basic object transform animation export:
- just writes all curves from action linked to an object
- linear interpolation
2009-07-21 19:08:36 +00:00
Chingiz Dyussenov
7e78d1c3bb Added objects(not bones yet) animation import. Matrix and Skew transformations are not supported. 2009-07-20 17:34:57 +00:00
Chingiz Dyussenov
9bfde6def0 Fixed textures import - images are assigned to faces. 2009-07-17 10:42:32 +00:00
Chingiz Dyussenov
1aca6face8 Added cameras and lamps import, properties are not taken into account
except position.
2009-07-17 06:12:58 +00:00
Chingiz Dyussenov
5a5b47c33e *Exporter handles empty objects.
*Added textures import.
TODO:
Fix images import.
2009-07-16 07:56:17 +00:00
Arystanbek Dyussenov
b334a45b35 COLLADA importer: base for object transform animation.
Fix a crash reported by Gary Richie: check NULL materials.
2009-07-15 18:59:49 +00:00
Chingiz Dyussenov
60e2416ac0 Added object hierarchy support to importer. 2009-07-13 08:41:37 +00:00
Arystanbek Dyussenov
7007f0c945 Importer:
- fixed multi-UV set import and made code more readable
- added #ifdef'ed console output useful for debugging
2009-07-10 11:32:55 +00:00
Arystanbek Dyussenov
42fba920be Importer fixes:
- remove empty meshes created by add_object call
- make_edges
- don't create a mesh object for non-mesh nodes
2009-07-10 08:43:37 +00:00
Chingiz Dyussenov
edf5200fa1 Added export objects hierarchy. 2009-07-10 06:55:05 +00:00
Chingiz Dyussenov
b91492c683 Added import multiple UV layers.
If <geometry> has more than one primitive - UVs aren't imported properly.
Will fix this soon.
2009-07-08 11:55:11 +00:00
Chingiz Dyussenov
861a0d20c6 Small fix - now import per-face materials should work properly. 2009-07-03 07:54:55 +00:00
Chingiz Dyussenov
9cc690b0d1 Import per-face materials. 2009-07-02 12:35:46 +00:00
Chingiz Dyussenov
f86100b358 Import:
*materials are assigned to objects.
TODO:
*import UVs
2009-07-02 05:43:14 +00:00
Chingiz Dyussenov
1bd28c878b * Export cameras and lights.
* Import materials. 
TODO:
Assign materials to objects.
2009-07-01 18:18:53 +00:00
Arystanbek Dyussenov
d8313b70f3 Exporter:
- texture/UV set binding
- extract names correctly from id.name
- output <unit name="meter" meter="1"/> in <asset>, dunno if this fits Blender
2009-06-30 19:37:28 +00:00
Chingiz Dyussenov
50db74f62b Export textures mapped to diffuse, ambient, specular, emission and reflective colors.
Input is always assumed to be UV.

Texture/UV set mapping is not done yet.
2009-06-30 09:10:37 +00:00
Chingiz Dyussenov
10e1904880 Added multiple UV layers export.
Next: texture/UV binding.
2009-06-29 12:53:49 +00:00
Chingiz Dyussenov
9e987a7afe Fixed bug which I mentioned in my previous commit - mesh will be
exported properly if it has no materials.
2009-06-28 15:33:10 +00:00
Chingiz Dyussenov
d7fa3d6c80 Added per-face materials exporting. If mesh has no materials it won't be
exported.
2009-06-28 13:20:37 +00:00
Chingiz Dyussenov
14fd54554c Added export material properties. The following shader types are
supported: phong and blinn all others are exported as <lambert>. Here is 
the list of supported shader options: emission, ambient, diffuse, 
specular, shininess, reflective, reflectivity, transparency, index of 
refraction. 
Turned off texture exporting - needs fixing.
2009-06-27 12:58:34 +00:00
Arystanbek Dyussenov
b8f6221c8b Object rotation read/write.
The new QuatToAxisAngle function could go to BLI_arithb.h.
2009-06-27 09:29:30 +00:00
Chingiz Dyussenov
2f3b3e5f33 Import:
* Objects are created and linked to meshes. 
* Since I don't know how to import per-face normals, they are generated automatically by mesh_calc_normals.
* Objects are imported with transformations but without rotation yet.
2009-06-26 11:25:19 +00:00
Arystanbek Dyussenov
ab183755da Quick fix to allow reading of <polylist> and <polygons>.
Treating <polylist> as <polygons> in OpenCollada seems intentional, not a bug.
2009-06-25 16:25:07 +00:00
Chingiz Dyussenov
78110f23d4 Added very basic geometry import. Only <triangles> is supported.
Found a bug in OpenCollada - <polylist> is treated as <polygon>.
2009-06-25 12:13:32 +00:00
Chingiz Dyussenov
e53eda5ba9 * Fixed material/texture binding
* Export polylist instead of triangles

TODO:
* Exporting per-face materials
* Multiple UV channels
2009-06-23 12:15:14 +00:00
Chingiz Dyussenov
a0d7164158 COLLADA exporter:
* removed code duplication for object and material traversing
* removed geometry, material, image duplication in produced DAE

TODO:
* UVs export still needs fixing/improvments
* Material/texcoord binding is not done
2009-06-22 16:21:59 +00:00
Chingiz Dyussenov
a82d3dec41 Multi-texture material export (unfinished).
Import geometry using mesh editor module commented out. Will use blenkernel module instead.
2009-06-22 13:23:13 +00:00
Arystanbek Dyussenov
02acf9c354 Importer base for Chingiz. 2009-06-17 11:16:18 +00:00
Chingiz Dyussenov
d8479c0fbb I rewrote the code which creates <library_materials>, <library_effects> and
<instance_material>. I used here more suitable Blender's api. Now exporter 
exports all materials in the scene. Todo: if material has textures export them.
2009-06-17 05:45:39 +00:00
Chingiz Dyussenov
b2f50b1b2a Exporter applies the first image in the scene to all objects which have
uv coordinates.
2009-06-16 08:58:33 +00:00
Chingiz Dyussenov
60a6600515 Fixed MaterialsExporter and EffectsExporter classes. 2009-06-15 10:53:01 +00:00
Chingiz Dyussenov
aecfa67497 Added exporting object textures, classes for writing <library_effects>
and <library_materials>. These classes are hardcoded.
2009-06-15 06:00:00 +00:00
Chingiz Dyussenov
fbadae7b0a Added uvs export. Textures and materials are not exported yet. 2009-06-10 18:02:54 +00:00
Chingiz Dyussenov
af67f4f634 Added normals export and fixed multiple object export. 2009-06-10 09:47:30 +00:00
Chingiz Dyussenov
d3f0b39c5f Basic exporter writing only vertices and faces converted to triangles.
Spen't lots of time debugging the misbehaving COLLADASW::URI 
constructor. The problem is although I pass correct parameters to it, 
the resulting file ends up having empty url attributes. It is either a 
bug in OpenCollada or my code - couldn't figure this out.
2009-06-07 05:14:25 +00:00
Chingiz Dyussenov
5acc0fd60d Added BF_OPENCOLLADA_* and BF_PCRE_* scons settings to linux config.
OpenCollada and pcre are added as 3rd party libraries collada module 
depends on.

I now build Blender with:
scons BF_DEBUG=1 BF_OPENCOLLADA_LIBPATH=/home/chin/src/opencollada/ BF_OPENCOLLADA=/home/chin/src/opencollada
2009-06-07 05:03:55 +00:00
Chingiz Dyussenov
61f71f0922 Added "Collada Export" menu. Put it in wm_operators.c temporarily.
Will discuss placement of this code on Sunday meeting.
2009-05-25 12:41:35 +00:00
Arystanbek Dyussenov
7482c14190 Small fix that should make C functions properly export from bf_collada. 2009-05-25 11:42:14 +00:00
Arystanbek Dyussenov
70066705a9 Created blender/source/collada skeleton for new 'bf_collada' lib
- setup SConscript, not sure about these values: libtype='core', priority=150
- only scons build on linux is set up
- not configured to link to OpenCollada yet
2009-05-25 08:46:24 +00:00