Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2015-03-22 15:26:46 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-03-22 15:26:46 +0300
commitc27ef5692c2d155fc25efe2a26fb81b80ffae42f (patch)
tree3f38f00d7d4acfc47b68fb1d9b59de145e65ed1e
parent045350c3b172d9abe3950d579135d667849cb252 (diff)
Simple inclusion of alembic files from inside xml files for cycles
standalone. The cycles XML files now can refer to Alembic (.abc) files. This will call the default alembic reader to read in scene data. Currently it simply prints the Alembic file structure. Eventually a proper schema needs to be defined for both xml and abc. Also care has to be taken to handle potential conflicts between settings both within xml/abc and between them.
-rw-r--r--intern/cycles/app/cycles_xml.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index 05e34387eb7..471f08e78d0 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -42,6 +42,9 @@
#include "util_xml.h"
#include "cycles_xml.h"
+#ifdef WITH_ALEMBIC
+#include "cycles_alembic.h"
+#endif
CCL_NAMESPACE_BEGIN
@@ -1109,6 +1112,25 @@ static void xml_read_state(XMLReadState& state, pugi::xml_node node)
state.displacement_method = Mesh::DISPLACE_BOTH;
}
+/* Alembic */
+static void xml_read_alembic(const XMLReadState& state, pugi::xml_node node)
+{
+#ifdef WITH_ALEMBIC
+ string filepath;
+
+ if(xml_read_string(&filepath, node, "file")) {
+ filepath = path_join(state.base, filepath);
+
+ if(xml_equal_string(node, "type", "hdf5"))
+ abc_read_hdf5_file(state.scene, filepath.c_str());
+ else if(xml_equal_string(node, "type", "ogawa"))
+ abc_read_ogawa_file(state.scene, filepath.c_str());
+ else
+ abc_read_ogawa_file(state.scene, filepath.c_str()); /* default */
+ }
+#endif
+}
+
/* Scene */
static void xml_read_include(const XMLReadState& state, const string& src);
@@ -1158,6 +1180,9 @@ static void xml_read_scene(const XMLReadState& state, pugi::xml_node scene_node)
if(xml_read_string(&src, node, "src"))
xml_read_include(state, src);
}
+ else if(string_iequals(node.name(), "alembic")) {
+ xml_read_alembic(state, node);
+ }
else
fprintf(stderr, "Unknown node \"%s\".\n", node.name());
}