Sometimes you might want snapshots to affect just a few objects in the scene. Say if you want to make a configurable scene element that changes by itself without touching any other scene element. Koru can do that with Affects selection option of the snapshot.
Let’s make a simple scene with a door handle that you can configure a multiple ways using snapshots.
Making a Simple Scene
We’ll make a really simple door with two types of handles and two types of handle bases. Something like this:
Here we have a simple wood door, a square and a round base and two types of handles. What we want is to be able to switch between bases and handles independently. Let’s move them to the same place, so they can be easily interchanged:
Now we are ready to start.
Adding Snapshots for Bases
Switch to the snapshot panel and add a new snapshot:
By default snapshots capture everything in the scene, but we only need them to capture the visibility of our handles, so we do two things:
- we check Affects selection option to make the snapshot works only for the selected objects;
- we uncheck all the options except for Visibility, so the snapshots only captures the visibility of selected objects.
You should get this:
Now we need to select the objects we want the snapshot to control. Let’s start with the handle base. We hide the square one, select both square and round bases and click the Save button on the snapshot to store the new state:
The last step is to rename the snapshot to “Round base” so the name reflects the visible handle base that snapshot activates:
Now let’s repeat this for the square base. The idea is the same: we make a snapshot, enable its Affects selection option, leave only Visibility option enabled, keep both bases selected and hide the round one. Then save and rename the snapshot:
Done. You now have two snapshots that switch bases and leaving everything else intact. Let’s continue with handles.
Adding Snapshots for Handles
You do handles exactly the same as bases: you make a new snapshot for each configuration, enable its Affects selection option and uncheck everything except for Visibility option in its settings. Then select both handles, hide one of them, save the snapshot and update its name:
Then you do the same for the second handle:
Once done you can double-click snapshots in Koru to see them switching their scene elements regardless of the others. You can also export the scene to HTML and see it also works there.
Adding Snapshots for Materials
On top of that you can easily add some extra options with new snapshots. Say if we want to switch between silver and gold handles. We currently used silver material for both bases and handles, so lets make a snapshot that affects all the handles and bases, but only stores materials:
Now we can add another similar snapshot, name it “Gold”, then apply the gold material to all the handles and bases and re–save that snapshot:
Double–click both new snapshots and make sure both change all the handles' and bases' materials.
Now you can export the scene to HTML and get 6 snapshot buttons each of them changing their own part of the scene without affecting anything else.
If some of the snapshot don’t work as expected, you simply need to activate them in Koru, configure the proper state, select the elements you want to affect, make sure the Affects selection option is enabled and re–save the snapshot.
Here you can download the sample scene used in this tutorial.
Using the Affects selection option of snapshots lets you make partial snapshots that only changes a few elements of your scene, so you can significantly reduce the number of snapshots for configurable scenes.
See more tutorials below:
- Decals — how to place images on objects as decals;
- Lightmaps — how to compute scene lightmaps and configure them;
- Floor reflection — how to add and configure floor reflection;
- Watermarks — adding 2D image overlays;
- Taking Screenshots — how to add "Take Screenshot" button to your Koru exports;
- Loading Images — how to upload your own images to exported Koru scenes;
- Automatic Rotation — how to make your scene automatically rotates when idle;
- Customizing Snapshot Buttons — how to customize snapshot buttons with CSS;
- Creating Snapshot Buttons — when CSS is not enough you can create snapshot buttons yourself;
- Drop–Down Snapshots Menus — convert snapshots to configurable options;
- Manual Snapshots Control — how to activate a specific snapshot;
- Customizing Background — replace that gray gradient for scenes with transparent background;
- Non-Interactive Scenes — can exported scenes ignore mouse clicks?
- Fullscreen Button — how to change the fullscreen button look?
- Materials — Koru materials explained;
- Partial Snapshots — making snapshots that affect just some scene elements;
- Using Metadata — add extra information to nodes and use it in browser.