summaryrefslogtreecommitdiffstats
path: root/tests/scripts/dynscene_2.drgscr
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-07-10 15:45:14 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-07-11 12:06:23 +0000
commit87dbb35b843d75361297bf925e26d3fd5657fd9f (patch)
tree4fa9ac7c20338ba560dfc74fd74aaa213a787ef2 /tests/scripts/dynscene_2.drgscr
parent8b1f5b32bab50c517f7518ba9d901d1d0a76007b (diff)
Add some test scripts
...and start supporting // comments when loading commands via prgload (we already support this in the autoexec.drgscr, no reason not to do it for other files) Retyping is boring, and what's more important these also show concepts that a higher level API or a new editor implementation would use to manage the scene contents. Change-Id: Iefbe8efee47c475b91efe5b05602eb18b9749791 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests/scripts/dynscene_2.drgscr')
-rw-r--r--tests/scripts/dynscene_2.drgscr16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/scripts/dynscene_2.drgscr b/tests/scripts/dynscene_2.drgscr
new file mode 100644
index 0000000..78bd322
--- /dev/null
+++ b/tests/scripts/dynscene_2.drgscr
@@ -0,0 +1,16 @@
+// Assuming dynscene_1 has run, this shows how the mesh and materials could get replaced for a model
+
+// Temporarily disconnect from the scene
+setparent(kube, null)
+
+// Remove old material children
+kill(ka)
+
+// Add new ones (no point in this example since the old and new mesh both have 1 submesh but shows the concept)
+object(ka, ka, DefaultMaterial, kube, Slide1)
+
+// Change the mesh
+set(kube, sourcepath, #Sphere)
+
+// Reconnect to scene
+setparent(kube, Layer)