# Creating Artifacts

## **Creating and Uploading Uploadable Artifacts**

All the work related to preparing and building the geometry bundle of the artifact will be done in the latest version of the Content Creator Template ([github](https://github.com/morpheusxr/content-creator-template.git)) with the addition of the following package:

[UploadableArtifactsTemplate.unitypackage](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/aa0e6964-3796-4ef5-b79b-c4904ccf25f5/UploadableArtifactsTemplate.unitypackage)

Currently, we have the ability to add geometry to three special artifacts: Blank Grabbable, Blank Placeable, and Blank Grounded. Each of these three artifacts has its own unique behavior:

1. Grabbable - an object with physics (affected by gravity) that can be picked up by hand or a pointer.
2. Placeable - an object without physics that can only be moved as a decorator.
3. Grounded - an object that automatically aligns to the ground and can only be moved as a decorator.

As an example, let's demonstrate creating geometry for an artifact using the [Ford GT 2006](https://sketchfab.com/3d-models/ford-gt-2006-ee5db1918a2b4c8cbe0388b67dee4b17) model.

## **Creating the Bundle**

1. Download/Create the model.
2. Import the model into the project.
3. Place the model in the scene, configure it, and create a prefab.
4. Add a collider to the prefab, which will also handle interactions with the artifact. If you are using custom geometry (using MeshCollider) and you want this geometry to be applied to an artifact with physics (e.g., Blank Grabbable), you need to enable the Convex checkbox on the MeshCollider component.
5. To set the holding pose of the artifact, add the ArtifactSettings script to the prefab and enter the desired pose from the list into the HandPoseId field.
   1. Microphone\_Wearable&#x20;
   2. ChampagneNarrow&#x20;
   3. SpeakerCorner&#x20;
   4. ChampagneWide&#x20;
   5. ContentGlobe&#x20;
   6. Glove&#x20;
   7. Beer&#x20;
   8. MagnetDot&#x20;
   9. Tumbler&#x20;
   10. Brandy&#x20;
   11. Coffee&#x20;
   12. Latte
   13. Corner
   14. Microphone&#x20;
   15. Martini
6. To set an offset relative to the grip point, you need to adjust the position and rotation parameters of the prefab itself.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FCVmhozv7OA80bBzJZLUc%2Fimage.png?alt=media&#x26;token=7d2768c6-042c-4e07-9a02-5d2679934777" alt=""><figcaption></figcaption></figure>
7. Add the prefab to Addressables, checking the checkbox next to it.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FmYBVvDBwNYkelXmKkArg%2Fimage.png?alt=media&#x26;token=f0abf3c7-12a2-4517-ae26-5d4a80586199" alt=""><figcaption></figcaption></figure>
8. Build the bundle for all necessary platforms.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FvIyhwIQeq8Lj9ltTx3o4%2Fimage.png?alt=media&#x26;token=d187a610-3eb0-4ada-a7cc-3799c8fdcdb7" alt=""><figcaption></figcaption></figure>
9. Pack all the resulting folders into a zip archive.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FmxO4NGuLB9QBxfwDdLAe%2Fimage.png?alt=media&#x26;token=cf6631e5-2a99-4d8c-8e3f-e98745de9b35" alt=""><figcaption></figcaption></figure>

## Uploading to the Admin Panel

1. Uploading the geometry data to the admin panel happens on the Geometry data tab. Here, click the "Create new" button.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FSBfTr5WG3tK4XTs9vRCV%2Fimage.png?alt=media&#x26;token=d5cec6e0-1df1-47e6-9fc5-e1739803aa59" alt=""><figcaption></figcaption></figure>
2. Next, enter the name of the geometry data and select "Artifact" in the Kind field.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FXOrUThoocOUNismrPXWw%2Fimage.png?alt=media&#x26;token=44d87e71-546d-45a8-8d89-12f6a70a4415" alt=""><figcaption></figcaption></figure>
3. Then, load the version.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FtpkDD2UJaD04KhJyZZRN%2Fimage.png?alt=media&#x26;token=2cd4c035-1473-4a0b-8942-34910ba14f11" alt=""><figcaption></figcaption></figure>
4. Provide a description of the version and select the zip archive.

   <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FFztGvoxsXENJhVZ4yx62%2Fimage.png?alt=media&#x26;token=fa373f91-f8a0-4efb-b225-870d23b9d4d9" alt=""><figcaption></figcaption></figure>

### IMPORTAN&#x54;**:**

If you plan to create multiple different artifacts from this model or export multiple different models from your project, you need to:

* Go to the Adressables Groups window and select the group into which you're adding objects (by default, this is the Default Local Group).

  <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FFGyzQQvNlLEACTJL531z%2Fimage.png?alt=media&#x26;token=1cf7e787-ae1b-445b-a88e-cba0d5c02cb3" alt=""><figcaption></figcaption></figure>
* Click on it and in the inspector, find the parameter "Internal Bundle Id Mode" and select "Group Guid Project Id Entries Hash."

  <figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FBsqm4VFAAzR93wW5hMOS%2Fimage.png?alt=media&#x26;token=4daa689e-295b-46c6-9049-5f2148268ff9" alt=""><figcaption></figcaption></figure>

Otherwise, they will be built with the same internal ID, and you won't be able to load them into one world.

## Creating of Config and Adding to world

To create the config, you need to determine which prefab you will inherit from, and in this case, we chose Blank Grounded (available IDs can be found in the [MXR Registry](https://stage.morpheusxr.com/admin/realms/X8DDXwnoUsD3uigvvC5Qv#Asset%20manifests)).

```yaml
assetId: asset.morpheusxr.blank.grounded
```

Next, we override the name in the artifact menu.

```yaml
name: Ford GT 2006
```

If we want to replace the icon, we upload the artifact's icon to some cloud storage and copy the link into the preview parameters.

<figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FxC8MKedxs2X745xFGcDL%2Fimage.png?alt=media&#x26;token=cc735e0e-2af2-4593-9308-e6d08283d551" alt="" width="188"><figcaption></figcaption></figure>

```yaml
meta:
  preview: <https://storage.googleapis.com/xmorpheus-public-assets/artifacts/previews/fordIcon.png>
```

To replace the geometry, we need to know the geometry data ID from the admin panel, the version ID of that geometry data, and the artifact's ID from the manifest.

<figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FIpDRwvRg0mtI7SX6TTEf%2Fimage.png?alt=media&#x26;token=9717aeb2-ba34-4ff0-aace-9dfa6c950f0a" alt=""><figcaption></figcaption></figure>

```yaml
contents:
  - artifact:
      id: blank.grounded
      data: data.azNXZVB5l6XtEIUEcDX7p.6MK18W8_F2eCu5ndVXx9l
```

**Complete config**

[Ford\_config.yaml](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a9a59f7f-51af-449c-b104-6f53f7f833fe/Ford_config.yaml)

```yaml
assetId: asset.morpheusxr.blank.grounded
name: Ford GT 2006
meta:
  preview: <https://storage.googleapis.com/xmorpheus-public-assets/artifacts/previews/fordIcon.png>
contents:
  - artifact:
      id: blank.grounded
      data: data.azNXZVB5l6XtEIUEcDX7p.6MK18W8_F2eCu5ndVXx9l
```

After that, save it as a file with the extension .yaml and add it to the media folder of your world (the place where we add music and pictures). If everything went well, your config will appear in the list with a green icon.

<figure><img src="https://635876470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoGLlMbPppCt2Nk7qVGrh%2Fuploads%2FOBoSsnFFiJopNV9qFAo6%2Fimage.png?alt=media&#x26;token=817776f1-8b75-4059-94c2-aa6ef371bf0c" alt=""><figcaption></figcaption></figure>

If you have a red icon, then there was an error in your file: the link to the preview is incorrect, and it cannot fetch the image, the specified geometry data does not exist, etc.

After this, the next time you enter the world, your artifact will appear in the menu (if everything went smoothly), and you don't even need to reload the world :)
