projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scn->clear() can't be called from the load callback, because it
[laserbrain_demo]
/
src
/
metascene.cc
diff --git
a/src/metascene.cc
b/src/metascene.cc
index
e0b2b20
..
6059664
100644
(file)
--- a/
src/metascene.cc
+++ b/
src/metascene.cc
@@
-1,3
+1,4
@@
+#include <assert.h>
#include <string>
#include <regex>
#include "metascene.h"
#include <string>
#include <regex>
#include "metascene.h"
@@
-117,10
+118,15
@@
static bool proc_scenefile(MetaScene *mscn, struct ts_node *node)
// datapath
struct ts_attr *adpath = attr_inscope(node, "datapath");
if(adpath && adpath->val.type == TS_STRING) {
// datapath
struct ts_attr *adpath = attr_inscope(node, "datapath");
if(adpath && adpath->val.type == TS_STRING) {
- info_log("adding data path: %s\n", adpath->val.str);
mscn->datamap.set_path(adpath->val.str);
}
mscn->datamap.set_path(adpath->val.str);
}
+ // strip path
+ struct ts_attr *aspath = attr_inscope(node, "strip_path");
+ if(aspath && aspath->val.type == TS_NUMBER) {
+ mscn->datamap.set_strip(aspath->val.inum);
+ }
+
// walkmesh
struct ts_attr *awmesh = attr_inscope(node, "walkmesh");
if(awmesh && awmesh->val.type == TS_STRING) {
// walkmesh
struct ts_attr *awmesh = attr_inscope(node, "walkmesh");
if(awmesh && awmesh->val.type == TS_STRING) {
@@
-303,7
+309,7
@@
static void apply_mtledit(Scene *scn, const MaterialEdit &med)
int nobj = scn->objects.size();
for(int i=0; i<nobj; i++) {
Object *obj = scn->objects[i];
int nobj = scn->objects.size();
for(int i=0; i<nobj; i++) {
Object *obj = scn->objects[i];
- if(std::regex_match(obj->get_name(), med.name_re)) {
+ if(std::regex_match(obj->mtl.name, med.name_re)) {
apply_mtledit(&obj->mtl, med);
}
}
apply_mtledit(&obj->mtl, med);
}
}