Custom objects loaded from .scn files can be placed in folders. Within these folders, a file with the name .metaversefile is used as the starting point for a custom object app. A simple .metaversefile looks like this:
{
"start_url": "index.js"
}
.metaversefile Breakdown
Elements in a .metaversefile can have the following types:
- name – object name
- start_url – object starting file location reference. It can be “index.js” if loading a Three.js object defined by custom code or it can be something like “name.glb” for simple 3D objects. Use any of ours: GitHub repository or create your own.
<aside>
💡 If hosting on GitHub, a GitHub Pages site is the preferred method as referencing the direct GH file download URL can cause problems. To enable GH Pages for your repo: go to the settings for your repo and in Pages section, enable Pages. For more information: GitHub Pages Documentation
</aside>
- components – object properties
- keys enabling “E” - can have various actions like “wear” or “use” that specify what function(s) the object should perform
- wear - enables wearing
- values:
- skinnedMesh - references the mesh to which a skinned wearable should be attached. It can be the exact name of the .glb file.
- boneAttachment - to which bone an unskinned wearable should be attached
- Available bones - head, spine, leftHand, rightHand, leftFoot, rightFoot, neck, chest
- use - used when an animation or behavior need to be attached to a .glb model. Example: drinking a held potion.
- values:
- animation - builtin animations associated with wearable use action
- Available animations - combo, slash, rifle, pistol, magic, eat, drink, throw, bowDraw, bowIdle, bowLoose
- behavior - builtin behaviors associated with wearable use action
- Available behaviors - sword, throw, eat, drink
- ik - builtin inverse kinematics for aiming weapons
- Available iks - pistol, bow
- pet - enables pet following
- values:
- idleAnimation - builtin animations associated with idling pets
- Available animations - idle
- walkAnimation
- runAnimation
- look - enables a pet looking
- sit - enables sitting upon or riding
- values:
- subtype - builtin animations associated with sitting
- Available animations - chair, saddle, stand
- aim - enables aiming ranged weapons
- values:
- subtype - builtin animations associated with aiming
- Available animations - swordSideIdle, swordSideIdleStatic, swordSideSlash, swordSideSlashStep, swordTopDownSlash, swordTopDownSlashStep, swordUndraw
- jump - enables jumping
- float - enables floating
- dance - enables dancing
- values:
- subtype - builtin animations associated with dancing
- Available animations - dansu, powerup
- throw - enables throwing
- values:
- subtype - builtin animations associated with throwing
- Available animations - throw
- activate - enables activating
- values:
- subtype - builtin animations associated with activating
- Available animations - grab_forward, grab_down, grab_up, grab_left, grab_right
- narutoRun - enables naruto running
- values:
- subtype - builtin animations associated with the naruto run
- Available animations - narutoRun
- hurt - enables hurting
- values:
- subtype - builtin animations associated with hurting
- Available animations - pain_back, pain_arch
Example folder structure of a complex object
.
..
.metaversefile
.nojekyll
index.js
.nojekyll
When hosting objects on GitHub Pages, Jekyll processes files or directories starting with underscores as special resources and does not copy them to the final site. It is now possible to completely bypass Jekyll processing by creating a file named .nojekyll in the root of your repo.