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
path: root/intern
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-26 16:13:41 +0300
commit902a747f60641a09dedd504e768fe94c407d693c (patch)
tree496cc595aa77707601a84f40e68322e199efe3e6 /intern
parent074281708829490e050089ae4683d1f1b8ec8392 (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.
Diffstat (limited to 'intern')
-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());
}