# sparkar-transfer

> A Spark AR tool to send any object's transform value to Patch Editor.

Latest version **0.1.2** (published 2020-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install sparkar-transfer
pnpm add sparkar-transfer
yarn add sparkar-transfer
bun add sparkar-transfer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2020-05-14 |
| First published | 2020-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Pofu Lu |
| Maintainers | pofulu |
| Keywords | sparkar, spark-ar, transform, transfer, patch-editor, pofu |

## Links

- npm: https://www.npmjs.com/package/sparkar-transfer
- Repository: https://github.com/pofulu/sparkar-transfer
- Homepage: https://github.com/pofulu/sparkar-transfer#readme
- Issues: https://github.com/pofulu/sparkar-transfer/issues
- npm.io page: https://npm.io/package/sparkar-transfer

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2020-05-14
- 0.1.1 — 2020-05-14
- 0.1.0 — 2020-05-14

## README

# Transfer

![index](https://github.com/pofulu/sparkar-transfer/blob/master/README.assets/index.gif?raw=true)

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



## Install

### Import

0. [Download Transfer.js](https://raw.githubusercontent.com/pofulu/sparkar-transfer/master/TransferDemo/scripts/Transfer.js) (Right click and Save as)

2. Drag/Drop or import it to Spark AR

3. (Optional) Load in the required modules

    ```javascript
    const Transfer = require('./Transfer');
    // Your script...
    ```

4. You can also [Click Here to Download a Sample Project](https://yehonal.github.io/DownGit/#home?url=https://github.com/pofulu/sparkar-transfer/tree/master/TransferDemo).

### npm

0. Add package with `yarn` or `npm`

    ```shell
    yarn add sparkar-transfer
    ```

    or

    ```shell
    npm i sparkar-transfer
    ```

1. Load in the required modules. If you use webpack to transpile code, you must import this module.

    ```javascript
    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 Pattern | Type|Description                                                  |
    | ---------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
    | `name_p`         | `Vector3`                                    |The position value of the `name` object.|
    | `name_s`         | `Vector3` |The scale value of the `name` object.|
    | `name_r`         | `Vector3` |The rotation value of the `name` object, **in degree.**|
    | `name_wp`        | `Vector3` |The world position value of the `name` object.|
    | `name_ws`        | `Vector3` |The world scale value of the `name` object.|
    | `name_wr`        | `Vector3` |The world rotation value of the `name` object.|
    | `name_pp`        | `Vector2` |The position value in screen percentage of the `name` object. Please refer [Here](https://github.com/pofulu/Spark-AR-PFTools/tree/master/PFScreen) 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.

---
_Source: https://npm.io/package/sparkar-transfer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
