]> git.tdb.fi Git - libs/gl.git/blobdiff - source/builders/sequencetemplate.cpp
Add inline data items to the collection
[libs/gl.git] / source / builders / sequencetemplate.cpp
index d852643301fa0ecac87fe0114b514bbe4478b45e..3ad973139010ae60b6e5cc5d602a9a0e1aca8aef 100644 (file)
@@ -113,7 +113,11 @@ void SequenceTemplate::Loader::step_with_slot(const string &tag, const string &r
        stp.tag = tag;
        stp.slot_name = rend;
        if(coll)
-               load_sub(stp, *coll);
+       {
+               Step::Loader ldr(stp, *coll);
+               ldr.set_inline_base_name(format("%s/%d.step", get_source(), obj.steps.size()));
+               load_sub_with(ldr);
+       }
        else
                load_sub(stp);
 
@@ -145,6 +149,11 @@ void SequenceTemplate::Step::Loader::init()
        add("scene", &Loader::scene);
 }
 
+void SequenceTemplate::Step::Loader::set_inline_base_name(const string &n)
+{
+       inline_base_name = n;
+}
+
 void SequenceTemplate::Step::Loader::blend_predefined(const string &name)
 {
        const Blend *bln = 0;
@@ -187,13 +196,13 @@ void SequenceTemplate::Step::Loader::lighting_inline()
 {
        RefPtr<Lighting> lightn = new Lighting;
        load_sub(*lightn);
-       obj.lighting = lightn;
+       get_collection().add(inline_base_name+".lightn", lightn.get());
+       obj.lighting = lightn.release();
 }
 
 void SequenceTemplate::Step::Loader::lighting(const string &name)
 {
        obj.lighting = &get_collection().get<Lighting>(name);
-       obj.lighting.keep();
 }
 
 void SequenceTemplate::Step::Loader::object(const string &name)