4. VRay Scenes
Last updated
Last updated
The import process is probably the simplest and most straightforward step in the workflow.
It is essentially very similar to the import process for any other type of assets. There are, however, a few things to keep in mind about re-uploading/updating these assets, to ensure a trouble-free experience.
When dragging and dropping the vrscene/vrscenezip files onto the Asset Library on ThreeKit, the user will be presented with the import dialog box. Here, the user can choose what the originating 3D tool was, along with a choice between importing the asset as a Scene, Model, or Material extraction, as shown in the screenshot below:
The option to import the vrscene assets as Scenes will automatically create a scene asset for each vrscene or vrscenezip added. In the case where the user uploads a vrscenezip that contains multiple vrscene files, it will create a single Scene asset, with multiple vrscene nodes inside that asset, for each vrscene file included in the zip.
The import process will extract the mesh, material, textures, and render settings data into a vrscene node inside the scene asset, while the camera information will be extracted separately into a ThreeKit camera node.
Here is an example of the basic output contents of a scene generated through this import process:
On the left side, in the Nodes section, you will find the following hierarchy of nodes created automatically by the import process:
NODE | DESCRIPTION |
Vray Axis System | This is a transform node that accounts for the differences between the transforms of assets in the different 3D applications. It is required to ensure the Vray components will render in the correct spot with the correct orientation and scale. |
ExampleScene | This is the vrscene node that contains all the information about the objects, materials, and lights in the uploaded vrscene. If it contains lights, then it will also showcase an operator for setting up the light-linking. If custom nodes were detected with the TK_ prefix in their name, they will also be displayed on this node for configuration. Under this node you will find the various models and lights that were detected in the vrscene file. |
ExampleScene Camera | This camera contains the same transform and focal length as the render camera in the vrscene, along with the Vray Physical Camera properties if those exist. As shown on the Properties panel of the scene node, this camera is also automatically set as the active camera for this scene asset. |
For Models | This node contains a scale that will get applied to any children added under this node. It is meant to be used with referenced assets from the Asset Library. Any other models that were imported either through a vrscene Model upload, or FBX uploads can be drag-and-dropped here. This will ensure that they will render at the correct scale with the other vrscene components under the Vray Axis System listed above. |
Model | This is a reference node, meant to be assigned a model asset through configuration. This is why the import process also adds a model asset attribute in the Logic section of the scene, titled Asset, along with a rule that sets the model of the node Model to the incoming value on the attribute Asset. This setup makes this scene essentially ready to be used with a Stage as is, without the need to set up any additional logic. |
This does not mean, however, that this setup is set in stone. It is to be considered simply as a starting point. The user can add any number of other model assets to the scene after the import. What is important though, is that in order to keep the transform and scale matching correctly, all additional assets need to be added to the scene under the transform node For Models. If added outside of that transform node, they will appear at the wrong scale.
This whole setup makes getting started with a vrscene import easier in many cases. It does, however, come with a downside. When the vrscene needs to be re-imported, due to updates made to the lights or background models, the import process will recreate the whole scene graph, removing any other changes or assets that were added by the user previously. For example, if the user added to this scene some additional Nulls or model assets, those nodes will disappear after a re-import of this vrscene.
For this reason, the lights and background scene models may be better imported as separate model assets, instead of importing them altogether as a scene. They can then be added to the scene asset as model references under the node For Models. This way, the only reason to ever update the main scene asset with a re-import is if the user wishes to import a new camera or additional cameras, without manually creating them on ThreeKit.
If the user has modified the contents of the scene, it would be easier to simply add or modify the existing cameras directly on ThreeKit, rather than importing them again through a vrscene that would overwrite the current setup.
Modifying the existing camera transform may prove difficult in some cases, due to significant differences in the transform numbers between ThreeKit and the 3D application. In that scenario, importing the new camera through a separate vrscene would be easier. From there, the user can have two tabs open at the same time, and then copy/paste the transforms from one camera to the other.
When working with cameras on ThreeKit, please note that the default behavior will always maintain an upright camera position. This means that the user can’t modify the Z rotation on the camera with the desired effect, without also enabling the “Allow Roll” checkbox under the camera’s Constraints, as shown here:
For situations where a Vray Physical Camera may be necessary, the ThreeKit platform provides access to those properties through the Vray Physical Properties operator on the camera itself. This operator will get added automatically on import, if these properties are detected inside the vrscene. The user can also add the operator after the import. The properties available under this operator have a direct match with what you would normally find inside the 3D application as well.
Any nodes from the vrscene that were named with the TK_ prefix will be exposed for configuration directly on the parent vrscene node:
In order to apply a VFB preset to a render, the VFB asset will need to be added to the Vray Post Effects slot of the scene used for the render. This is the only location where the VFB asset can be used:
The Vray Post Effects subsection under the Scene Properties panel currently represents the only supported Post Effects that apply to Vray renders. The other Post Effects available in the Properties panel only apply to the Webgl 3D player.
This slot can also be configured in the Logic panel through the use of the Set Property action inside a rule. This allows the user to swap the VFB preset based on various conditions.
In cases where the product requires to have both a Webgl and a Vray version, the use of a Scene Proxy asset would be required. The Scene Proxy asset provides a slot for Vray Scenes, and a slot for Webgl scenes. The appropriate slots would be used depending on whether this Scene Proxy asset gets requested during a Virtual Photographer Render job request, or whether it is requested by the 3D Webgl player.