[Bf-blender-cvs] [a76364a97a7] collada: Feature Collada: Prepare for exporting all actions of a scene

Gaia Clary noreply at git.blender.org
Wed Mar 28 21:30:27 CEST 2018


Commit: a76364a97a7c0b046b7a4da0ec6c223ca040387b
Author: Gaia Clary
Date:   Sun Mar 4 19:49:18 2018 +0100
Branches: collada
https://developer.blender.org/rBa76364a97a7c0b046b7a4da0ec6c223ca040387b

Feature Collada: Prepare for exporting all actions of a scene

bc_getSceneActions(Object *ob, bool all_actions)

This function is supposed to return the list of actions
to be exported for the given object. However the function
is not yet used. Also it needs an improvement such that only
actions which match the active object will be exported.
This is still work in progress.

===================================================================

M	source/blender/collada/collada_utils.cpp
M	source/blender/collada/collada_utils.h

===================================================================

diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index b043a359db9..4d25010eb59 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -138,16 +138,27 @@ Main *bc_get_main()
 	return G.main;
 }
 
-std::vector<bAction *> bc_getSceneActions()
+std::vector<bAction *> bc_getSceneActions(Object *ob, bool all_actions)
 {
 	std::vector<bAction *> actions;
-	Main *main = bc_get_main();
-	ID *id;
-
-	for (id = (ID *)main->action.first; id; id = (ID *)(id->next)) {
-		bAction *act = (bAction *)id;
-		actions.push_back(act);
+	if (all_actions) {
+		Main *main = bc_get_main();
+		ID *id;
+
+		for (id = (ID *)main->action.first; id; id = (ID *)(id->next)) {
+			bAction *act = (bAction *)id;
+			/* XXX This currently creates too many actions.
+			   TODO Need to check if the action is compatible to the given object
+			*/
+			actions.push_back(act);
+		}
+	}
+	else
+	{
+		bAction *action = bc_getSceneObjectAction(ob);
+		actions.push_back(action);
 	}
+
 	return actions;
 }
 
diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index 4eca0d1670c..7989c31fa07 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -73,7 +73,7 @@ extern void bc_update_scene(Scene *scene, float ctime);
 
 /* Action helpers */
 
-std::vector<bAction *> bc_getSceneActions();
+std::vector<bAction *> bc_getSceneActions(Object *ob, bool all_actions);
 
 inline bAction *bc_getSceneObjectAction(Object *ob)
 {



More information about the Bf-blender-cvs mailing list