Skip to content

Blend Load

App: apps/blend_load/

Loads Models/Cube.blend, instantiates the Cube collection (with a draggable cube) and optionally GameCamera and Light from the blend file. Uses an FPS camera and raycast to drag the cube with the mouse.

Terminal window
% ./plume3d blend_load

or

Terminal window
% ./../plume3d .
  • Creates a scene and loads the default shader.
  • Loads the blend with Resource.loadBlend("Models/Cube.blend"), logs nodeCount, nodeName(i), nodeId(i).
  • Instantiates Cube: gets the node with nodeId "model" and passes it to a Cube script that handles raycast-drag rotation.
  • Camera — Either instantiates GameCamera from the blend and builds an FPSCamera from it, or creates a camera in code (configurable via USE_BLEND_ASSETS).
  • Light — Either instantiates Light from the blend or creates a point light at (4, 4, 4) in code.
  • Left-click + drag on the cube rotates it; right-click + drag to look; WASD / Space / Ctrl to move.
  • ResourceloadBlend.
  • BlendResultinstantiate(className, scene), nodeCount, nodeName, nodeId, nodes on the instantiated root.
  • Scenenew, addNode, addLight, addCamera, findCameraByTag, findLightByTag, draw.
  • RaycastfromCamera for mouse picking.
  • GraphicsloadShader, useShader, setViewMatrix, setProjectionMatrix, setViewProjectionEnabled.
  • Input, Window.

The engine reads class data from ID custom properties in the saved .blend file. The Plume3D addon writes that on File → Save.

  1. Save after configuring — In Blender, set Class Name, Script Path, Node Id, etc., then save (Ctrl+S).
  2. Enable Wren Script Config — For each object/collection that should be a class, the “Enable Wren Script Config” checkbox must be checked.
  3. Debug — Run with PLUME3D_BLEND_DUMP=blend_parse.txt ./plume3d ... and inspect blend_parse.txt to see what the loader sees (e.g. className per node).