From 9da2c0c6c2507e16a6c38361f423c9eb35d40546 Mon Sep 17 00:00:00 2001 From: Stefan Gartner Date: Sun, 10 Jan 2010 09:11:48 +0000 Subject: add OpenCOLLADA support to Makefiles add "export WITH_OPENCOLLADA=true" to user-def.mk to enable it --- source/blender/collada/Makefile | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 source/blender/collada/Makefile (limited to 'source/blender/collada') diff --git a/source/blender/collada/Makefile b/source/blender/collada/Makefile new file mode 100644 index 00000000000..29a731dbcb2 --- /dev/null +++ b/source/blender/collada/Makefile @@ -0,0 +1,42 @@ +# +# $Id: +# +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) 2008 Blender Foundation. +# All rights reserved. +# +# Contributor(s): none yet. +# +# ***** END GPL LICENSE BLOCK ***** +# +# + +LIBNAME = bf_collada +DIR = $(OCGDIR)/blender/bf_collada + +include nan_compile.mk + +CCFLAGS += $(LEVEL_1_C_WARNINGS) + +CPPFLAGS += -I../makesdna -I../blenlib -I../blenkernel -I../editors/include +CPPFLAGS += -I../windowmanager -I../makesrna +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include +CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADABaseUtils +CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADAFrameWork +CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADAStreamWriter +CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADASaxFrameworkLoader -- cgit v1.2.3 From 34794eafe495586761af883b292c16a939d17df8 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sun, 10 Jan 2010 21:58:40 +0000 Subject: SVN maintenance. --- source/blender/collada/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/collada') diff --git a/source/blender/collada/Makefile b/source/blender/collada/Makefile index 29a731dbcb2..f2fed004a25 100644 --- a/source/blender/collada/Makefile +++ b/source/blender/collada/Makefile @@ -1,5 +1,5 @@ # -# $Id: +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # -- cgit v1.2.3 From 574049782a34dcdc0f67b6c3077dc1e99db0d09e Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Wed, 13 Jan 2010 12:51:07 +0000 Subject: Merge -c 25963 from COLLADA branch into trunk. --- source/blender/collada/DocumentExporter.cpp | 31 ++++++++++------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'source/blender/collada') diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index ef36a2eea9a..f0dd24a735f 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -859,11 +859,9 @@ private: return ob_arm; } - std::string get_joint_sid(Bone *bone) + std::string get_joint_sid(Bone *bone, Object *ob_arm) { - char name[100]; - BLI_strncpy(name, bone->name, sizeof(name)); - return translate_id(name); + return get_joint_id(bone, ob_arm); } // parent_mat is armature-space @@ -871,7 +869,7 @@ private: { std::string node_id = get_joint_id(bone, ob_arm); std::string node_name = std::string(bone->name); - std::string node_sid = get_joint_sid(bone); + std::string node_sid = get_joint_sid(bone, ob_arm); COLLADASW::Node node(mSW); @@ -1017,7 +1015,7 @@ private: for (def = (bDeformGroup*)defbase->first; def; def = def->next) { Bone *bone = get_bone_from_defgroup(ob_arm, def); if (bone) - source.appendValues(get_joint_sid(bone)); + source.appendValues(get_joint_sid(bone, ob_arm)); } source.finish(); @@ -1377,7 +1375,6 @@ public: } }; - class EffectsExporter: COLLADASW::LibraryEffects { public: @@ -1786,19 +1783,16 @@ protected: const char *axis_names[] = {"X", "Y", "Z"}; const char *axis_name = NULL; char anim_id[200]; - char anim_name[200]; if (fcu->array_index < 3) axis_name = axis_names[fcu->array_index]; - BLI_snprintf(anim_id, sizeof(anim_id), "%s.%s.%s", (char*)translate_id(ob_name).c_str(), + BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char*)translate_id(ob_name).c_str(), fcu->rna_path, axis_names[fcu->array_index]); - BLI_snprintf(anim_name, sizeof(anim_name), "%s.%s.%s", - (char*)ob_name.c_str(), fcu->rna_path, axis_names[fcu->array_index]); // check rna_path is one of: rotation, scale, location - openAnimation(anim_id, anim_name); + openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING); // create input source std::string input_id = create_source_from_fcurve(Sampler::INPUT, fcu, anim_id, axis_name); @@ -1957,7 +1951,6 @@ protected: const char *axis_names[] = {"X", "Y", "Z"}; const char *axis_name = NULL; char anim_id[200]; - char anim_name[200]; bool is_rot = tm_type == 0; if (!fra.size()) @@ -1972,14 +1965,10 @@ protected: std::string transform_sid = get_transform_sid(NULL, tm_type, axis_name); - BLI_snprintf(anim_id, sizeof(anim_id), "%s.%s.%s", (char*)translate_id(ob_name).c_str(), + BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char*)translate_id(ob_name).c_str(), (char*)translate_id(bone_name).c_str(), (char*)transform_sid.c_str()); - BLI_snprintf(anim_name, sizeof(anim_name), "%s.%s.%s", - (char*)ob_name.c_str(), (char*)bone_name.c_str(), (char*)transform_sid.c_str()); - - // TODO check rna_path is one of: rotation, scale, location - openAnimation(anim_id, anim_name); + openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING); // create input source std::string input_id = create_source_from_vector(Sampler::INPUT, fra, is_rot, anim_id, axis_name); @@ -2244,13 +2233,13 @@ protected: char *name = extract_transform_name(rna_path); if (strstr(name, "rotation")) - return std::string("rotation") + axis_name; + return std::string("rotation") + std::string(axis_name) + ".ANGLE"; else if (!strcmp(name, "location") || !strcmp(name, "scale")) return std::string(name); } else { if (tm_type == 0) - return std::string("rotation") + axis_name; + return std::string("rotation") + std::string(axis_name) + ".ANGLE"; else return tm_type == 1 ? "scale" : "location"; } -- cgit v1.2.3 From e307f6c6a0476d0ad68aded9033ec4f18532b58a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Jan 2010 13:50:17 +0000 Subject: rename defgroup functions to be more consistant. * no functional changes * --- source/blender/collada/DocumentImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/collada') diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 26e95c378a6..39424797df6 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -942,7 +942,7 @@ public: // at this stage we get vertex influence info that should go into me->verts and ob->defbase // there's no info to which object this should be long so we associate it with skin controller data UID - // don't forget to call unique_vertexgroup_name before we copy + // don't forget to call defgroup_unique_name before we copy // controller data uid -> [armature] -> joint data, // [mesh object] -- cgit v1.2.3