A Python script for rendering glTF files with V-Ray App SDK

Overview

V-Ray glTF viewer

Sample render

Overview

The V-Ray glTF viewer is a set of Python scripts for the V-Ray App SDK that allow the parsing and rendering of glTF (.gltf and .glb) files.

Installing and running the V-Ray glTF viewer

With V-Ray App SDK

  • Install Python 3.8 for all users in "c:\Program Files\Python38"

  • Install nightly V-Ray 5 App SDK (Qt version) in "C:\Program Files\Chaos Group\V-Ray\AppSDK". Be sure to choose the Advanced installation type and make sure the installation does not modify any license settings or environment variables.

    Note: In case you accidentally let the V-Ray App SDK installation modify the V-Ray license settings, run the tool setvrlservice.exe or from the start menu search for "Change V-Ray client license settings" to change them.

  • Open a command prompt (press Windows+R, type cmd and press Enter).

  • Execute set path="c:\program files\python38";"c:\program files\python38\scripts";%path%

  • First time only: Execute pip install numpy

  • First time only: Execute pip install pyquaternion

  • First time only: Execute pip install numba

  • First time only: Execute pip install scipy

  • Execute "C:\Program Files\Chaos Group\V-Ray\AppSDK\setenv38.bat"

  • Execute cd /d VRAY_GLTF_FOLDER where VRAY_GLTF_FOLDER is the folder where the file main.py is located.

  • Execute python main.py to see a list of options; use python main.py --help for detailed usage description.

With V-Ray 5 for 3ds Max

The Python binding of the V-Ray AppSDK is also included with V-Ray 5 for 3ds Max and Maya and in this case it is not needed to install the V-Ray AppSDK separately.

  • Make sure you have a recent version of V-Ray 5 for 3ds Max with the Python 3 binding of the V-Ray App SDK included (check if you have the folder "C:\Program Files\Chaos Group\V-Ray\3ds Max 2021\samples\appsdk\python38").

  • Install Python 3.8 for all users in "c:\Program Files\Python38"

  • Open a command prompt (press Windows+R, type cmd and press Enter).

  • Execute set path="c:\program files\python38";"c:\program files\python38\scripts";%path%

  • First time only: Execute pip install numpy

  • First time only: Execute pip install pyquaternion

  • First time only: Execute pip install numba

  • First time only: Execute pip install scipy

  • Execute "C:\Program Files\Chaos Group\V-Ray\3ds Max 2021\samples\appsdk\setenv38.bat"

  • Execute cd /d VRAY_GLTF_FOLDER where VRAY_GLTF_FOLDER is the folder where the file main.py is located.

  • Execute python main.py to see a list of options; use python main.py --help for detailed usage description.

Usage

The V-Ray glTF scripts are command-line only; there is no GUI and all options must be passed on the command line.

Use the --help option to list all possible options and their values.

An example command to render the sample .glb file could look like this (assuming that the vray_gltf project is extracted to d:\temp\vray_gltf):

python main.py d:\temp\vray_gltf\samples\basic\basic.glb --thick_glass --default_lights --default_cam_moffset "(0, 0, -0.5)" --output_file d:\temp\vray_gltf.jpg

Supported features

The glTF parser supports glTF 2.0 with the following extensions:

  • KHR_texture_transform
  • KHR_materials_pbrSpecularGlossiness
  • KHR_materials_transmission
  • KHR_materials_clearcoat
  • KHR_materials_sheen
  • KHR_lights_punctual is mostly working, but light range is not supported

Simple transform animations are supported to some extent. Vertex deformations, either through morphing or skinning are currently not supported.

Most of the sample models provided by Khronos generally render fine, as well as many models from the Windows 3D viewer library.

You might also like...
Box SDK for Python

Box Python SDK Installing Getting Started Authorization Server-to-Server Auth with JWT Traditional 3-legged OAuth2 Other Auth Options Usage Documentat

The Official Dropbox API V2 SDK for Python
The Official Dropbox API V2 SDK for Python

The offical Dropbox SDK for Python. Documentation can be found on Read The Docs. Installation Create an app via the Developer Console. Install via pip

Evernote SDK for Python

Evernote SDK for Python Evernote API version 1.28 This SDK is intended for use with Python 2.X For Evernote's beta Python 3 SDK see https://github.com

Python SDK for IEX Cloud
Python SDK for IEX Cloud

iexfinance Python SDK for IEX Cloud. Architecture mirrors that of the IEX Cloud API (and its documentation). An easy-to-use toolkit to obtain data for

Unofficial Medium Python Flask API and SDK
Unofficial Medium Python Flask API and SDK

PyMedium - Unofficial Medium API PyMedium is an unofficial Medium API written in python flask. It provides developers to access to user, post list and

The Python SDK for the Rackspace Cloud

pyrax Python SDK for OpenStack/Rackspace APIs DEPRECATED: Pyrax is no longer being developed or supported. See openstacksdk and the rackspacesdk plugi

:snake: Python SDK to query Scaleway APIs.

Scaleway SDK Python SDK to query Scaleway's APIs. Stable release: Development: Installation The package is available on pip. To install it in a virtua

Skyscanner Python SDK

Skyscanner Python SDK Important As of May 1st, 2020, the project is deprecated and no longer maintained. The latest update in v1.1.5 includes changing

WeChat SDK for Python
WeChat SDK for Python

___ __ _______ ________ ___ ___ ________ _________ ________ ___ ___ |\ \ |\ \|\ ___ \ |\ ____\|\ \|\ \|\ __ \|\___

Comments
  • Gltf file node name is missing?

    Gltf file node name is missing?

    this is my glTF file

    {
      "asset": {
        "generator": "Khronos glTF Blender I/O v1.8.19",
        "version": "2.0"
      },
      "scene": 0,
      "scenes": [
        {
          "name": "Scene",
          "nodes": [
            0
          ]
        }
      ],
      "nodes": [
        {
          "mesh": 0,
          "name": "c1",
          "translation": [
            50,
            20,
            30
          ]
        }
      ],
      "meshes": [
        {
          "name": "Cube",
          "primitives": [
            {
              "attributes": {
                "POSITION": 0,
                "NORMAL": 1,
                "TEXCOORD_0": 2
              },
              "indices": 3
            }
          ]
        }
      ],
      "accessors": [
        {
          "bufferView": 0,
          "componentType": 5126,
          "count": 24,
          "max": [
            1,
            1,
            1
          ],
          "min": [
            -1,
            -1,
            -1
          ],
          "type": "VEC3"
        },
        {
          "bufferView": 1,
          "componentType": 5126,
          "count": 24,
          "type": "VEC3"
        },
        {
          "bufferView": 2,
          "componentType": 5126,
          "count": 24,
          "type": "VEC2"
        },
        {
          "bufferView": 3,
          "componentType": 5123,
          "count": 36,
          "type": "SCALAR"
        }
      ],
      "bufferViews": [
        {
          "buffer": 0,
          "byteLength": 288,
          "byteOffset": 0
        },
        {
          "buffer": 0,
          "byteLength": 288,
          "byteOffset": 288
        },
        {
          "buffer": 0,
          "byteLength": 192,
          "byteOffset": 576
        },
        {
          "buffer": 0,
          "byteLength": 72,
          "byteOffset": 768
        }
      ],
      "buffers": [
        {
          "uri": "simple_data.bin",
          "byteLength": 840
        }
      ]
    }
    

    There is only one Cube with name c1, however, after exporting vrscene file, I cannot get the Node by

    renderer.GetPlugin<Node>("c1@node")
    
    opened by pigLoveRabbit520 1
Owner
Chaos
Makers of the popular V-Ray, Corona and Vantage renderers
Chaos
Graviti-python-sdk - Graviti Data Platform Python SDK

Graviti Python SDK Graviti Python SDK is a python library to access Graviti Data

Graviti 13 Dec 15, 2022
MONAI Deploy App SDK offers a framework and associated tools to design, develop and verify AI-driven applications in the healthcare imaging domain.

MONAI Deploy App SDK offers a framework and associated tools to design, develop and verify AI-driven applications in the healthcare imaging domain.

Project MONAI 49 Dec 23, 2022
A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

Amazon Web Services - Labs 1.9k Jan 7, 2023
A wrapper for aqquiring Choice Coin directly through a Python Terminal. Leverages the TinyMan Python-SDK.

CHOICE_TinyMan_Wrapper A wrapper that allows users to acquire Choice Coin directly through their Terminal using ALGO and various Algorand Standard Ass

Choice Coin 16 Sep 24, 2022
A Python library for rendering ASS subtitle file format using libass.

ass_renderer A Python library for rendering ASS subtitle file format using libass. Installation pip install --user ass-renderer Contributing # Clone

null 1 Nov 2, 2022
Clisd.py - UI framework with client side rendering for python

clisd.py Clisd is UI framework with client side rendering for python. It uses WA

null 2 Mar 25, 2022
Cdk-python-crud-app - CDK Python CRUD App

Welcome to your CDK Python project! You should explore the contents of this proj

Shapon Sheikh 1 Jan 12, 2022
AWS SDK for Python

Boto3 - The AWS SDK for Python Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to wri

the boto project 7.8k Jan 8, 2023
Python SDK for Facebook's Graph API

Facebook Python SDK This client library is designed to support the Facebook Graph API and the official Facebook JavaScript SDK, which is the canonical

Mobolic 2.7k Jan 7, 2023