0.1.2 • Published 4 years ago

sparkar-transfer v0.1.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Transfer

index

Transfer is a Spark AR tool to send any object's transform value to Patch Editor by naming, without additional script.

Install

Import

  1. Download Transfer.js (Right click and Save as)

  2. Drag/Drop or import it to Spark AR

  3. (Optional) Load in the required modules

    const Transfer = require('./Transfer');
    // Your script...
  4. You can also Click Here to Download a Sample Project.

npm

  1. Add package with yarn or npm

    yarn add sparkar-transfer

    or

    npm i sparkar-transfer
  2. Load in the required modules. If you use webpack to transpile code, you must import this module.

    const Transfer = require('sparkar-transfer');
    // Your script...

Usage

This tool make object follow head by naming:

  1. Add the keyword # to the name of object that you want to tranfer value to Patch Editor.

  2. Select any script and add the desired variables to From Script:

    Variable PatternTypeDescription
    name_pVector3The position value of the name object.
    name_sVector3The scale value of the name object.
    name_rVector3The rotation value of the name object, in degree.
    name_wpVector3The world position value of the name object.
    name_wsVector3The world scale value of the name object.
    name_wrVector3The world rotation value of the name object.
    name_ppVector2The position value in screen percentage of the name object. Please refer Here for more details.

Please note that you should avoid using the same base name. For example, these object named name #, name #, # name or # name will cause conflict in Patch variables.

Additional

  • You can use Transfer.logTrackedObjectNames() to log all tracked objects.