Skip to content

Spark AR tool for dynamically instantiating blocks and controlling them without coding.

Notifications You must be signed in to change notification settings

pofulu/sparkar-cloner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cloner

Cloner is a Spark AR tool for dynamically instantiating blocks and controlling them without coding.

You can do the following things in Patch Editor:

  • Instantiate block
  • Clear all instantiated blocks
  • Control the position/ rotation/ scale of the instance by index
  • Bridge instance's Inputs to Patch Editor with Inputs Map

Install

  1. Download Cloner.js (Right click and Save as)
  2. Download Cloner.arblock
  3. Drag/Drop both of them to your Spark AR project.
  4. Add capability: Project > Edit Properties > Capabilities > > Scripting Dynamic Instantiation
  5. You can also Click Here to Download a Sample Project (v112).

Usage

demo-basicDrag the Cloner Block to Scene and set inputs, these are basic settings:

Inputs Type Description
Instantiate Pulse Trigger this to create an instance.
Clear Pulse Trigger this to clear all instance.
Block Name Text The name of the block to be instantiated.
Parent Name Text The name of the scene object that holds instance.

demo-control-pos The following settings are used to control instance's Transform:

Inputs Type Description
Control Index Number The index of instance to be controlled.
The index is start from 0.
-1 means the last instantiated instance;
-2 means all of instances.
Position Vector 3 The position of controlled instance.
Scale Vector 3 The scale of controlled instance.
Rotation Vector 3 The rotation of controlled instance.

demo-control-inputs

You can control the Inputs of instance block with following advanced setting:

Inputs Type Description
Prefix Text The prefix of To Script varaible name.
Inputs Text The map to bridge instance's Inputs to To Script. Learn more.

Inputs Map

The map pattern should look like this: Name:type,Name:type,Name:type.

e.g. Your block has four property:

  1. Floaing with type Boolean
  2. Frequency with type Number
  3. Color A with type Color
  4. Color B with type Color

If you want to control the Floaing, Frequency and Color B, the map is;

Floating:b,Frequency:n,Color B:c

And then you need to add the the following To Script variables:

  1. Floaing with type Boolean

  2. Frequency with type Number

  3. Color_B with type Vector4

After restart, you can set these variables in Patch Editor.

Donations

If this is useful for you, please consider a donation🙏🏼. One-time donations can be made with PayPal.

About

Spark AR tool for dynamically instantiating blocks and controlling them without coding.

Topics

Resources

Stars

Watchers

Forks