Content Creation Tutorial (Python 3)

Name

Location

Content Creation<Vortex Studio Installation Folder>\tutorials\Python\Vortex\PycontentCreation\ContentCreation.py

This tutorial provides an example to create content with code. It is the python 3 equivalent of the C++ Content Creation Tutorial

In this tutorial, a rover is built, is connected to a joystick, and rolls on a plane.

It showcases the following

  • Assembly Document
    • Parts and collision geometry creation
    • Assembling with constraint
    • Material on the wheels.
  • Graphics Gallery Document
    • Import graphics from a graphics file
  • Assembly with Graphics
    • Adding a Gallery instance
    • Creating parts from a node
    • Part-node mapping
    • Creating collision geometries from graphics
  • Mechanism Document
    • Adds controls of the Assembly via
      • VHL Interface
      • Joystick
      • Python script
      • Connection Container
    • Configuration
      • Add an option to have a "Turbo mode" to the rover
  • Scene Document
    • Instantiate 9 Rovers in a 3x3 grid
    • Activate the Turbo configuration for some rovers
    • Adds Configuration to control the amount of rover visible in the scene.
    • The scene has no terrain. It's up to the user to add one by mimicking the steps in the C++ tutorials or by adding it's own terrain in the editor. 


See Vortex Studio SDK - Creating Content for more details

See Integrating Vortex Studio using Python 3 for more details about using Python.

Using the tutorial

  1. The code is fully documented explaining each step.
    1. For more detail, call the script with argument --help
  2. Set up the Python Environment in the Terminal for the execution of the script:
    1. Open a terminal to the location of the ContentCreation.py file
    2. set TOOLKIT_DIR=C:\CM Labs\Vortex Studio Installation Location
      set PYTHONPATH=%TOOLKIT_DIR%;%TOOLKIT_DIR%\bin;%PYTHONPATH%

      Note

      Make sure to change the first command-line instruction's path accordingly to your own installation folder's path

  3. Run the script with the following arguments:
    1. --destinationFolder <folder>: this is the folder where to save the scene, mechanism, gallery, and assembly documents
    2. --pythonScriptPath <path>: This is the python script path used by the rover controller. It is located at <Vortex Studio Installation Folder>\Resources\ExContentCreation\controller.py
    3. --materialsPath <materials>: Path to the Material table. One is provided at <Vortex Studio Installation Folder>\resouces\ExContentCreation\default.vxmaterials
    4. --graphicsPath <graphics>: Path to the dump truck graphics file. It is located at <Vortex Studio Installation Folder>\resouces\ExContentCreation\dumptruck.ive
  4. In the destination folder, you will have the vortex files created by the script.
    1. Open them in the editor to try them. There is almost no graphics so you will need to enable Geometry visualization.
  5. To go into detail, debug the script and follow the code execution step by step.