Welcome to Spine! :cooldoge: I'm happy to field your questions.
Kinvert schriebWe hope to have some parts of the avatars be scalable. For example they might want their avatar a little taller. So the number of bones would stay the same, but the whole thing would need to scale.
You can adjust the transforms (rotation, translation, scale, shear) of bones at runtime. For example, you could set the scale on a bone to make the skeleton taller, arms longer, etc, just like you can do in Spine by adjusting the transform.
Runtime Skeletons - Spine Runtimes Guide
API Reference - Spine Runtimes Guide
API Reference - Bone
You can also setup constraints that adjust the skeleton, then control the constraint mixes to get a result somewhere between no constraint applied and the constraint fully applied.
Transform Constraints - Spine User Guide
Kinvert schriebWe want to create the animations ONCE and have those animations work for all the avatars. We realize we might need to give all bones the same name, etc. Can your software do this?
Absolutely. Spine's slots and skins facilitate such reuse. Skin constraints (and skin bones) allow you to have constraints that are only applied for some skins.
Basic Concepts - Spine User Guide: Slots
Skins - Spine User Guide
Skins - Spine User Guide: Skin constraints
Skins - Spine User Guide: Skin bones
Kinvert schriebCan we take an existing rig, and replace its arm SVG with a new arm SVG, then the head SVG with a new head SVG? We can't redo the rigging for each users avatar as there will be thousands of possible avatars they create.
Yes, with proper planning you can setup your skeleton so that you don't need to attach every image to the skeleton in Spine. Typically you'd have attach a set of attachments in Spine as a template, then you'd use copy those attachments at runtime and customize what images they use.
Runtime Skins - Spine Runtimes Guide: Creating attachments
Kinvert schriebIf we use Mesh, how might this workflow go? For example can we create mesh for "arm_design_2" and "arm_design_5" and when we replace one arm with the other, it will have the correct mesh, and be associated with the correct bone?
If you take a template mesh, duplicate it, and change which image it uses, then it will have the same weights for the same bones, so it will deform in the same way. Note generally it is better for reuse (and other reasons) to use weights rather than deform keys.
Spine also has "linked meshes" which is a mesh that uses the vertices, edges, UVs, triangles, and weights of another mesh (the "source mesh"). This is similar to duplicating a mesh, but a little more efficient because it shares that data. Also Spine-the-editor it is more convenient than duplication, since with duplication if you modify the mesh you'd have to make the same changes to all the duplicates.
Meshes - Spine User Guide: Linked meshes
Kinvert schriebHow does this export? Avatars will be an SVG. I think there would be an SVG for the arm, one for the head, one for the eyes, etc.
Spine-the-editor works only with raster images. You'll need to export images from Illustrator or other software so you can bring them into Spine. We have scripts for doing that and also generating a JSON skeleton data file so the images are positioned in Spine as they were in Photoshop/Illustrator/etc. Of these, the Photoshop script has the most features and is recommended, if possible. We also have an Illustrator script, though it is more basic (doesn't support tags in the layer names to control how the JSON is generated):
spine-scripts/photoshop at master · EsotericSoftware/spine-scripts
spine-scripts/illustrator at master · EsotericSoftware/spine-scripts
The skeletal data exported from Spine is not tightly coupled to the images: attachments have a name/path that is used at runtime to determine what is drawn for that attachment.
Images - Spine User Guide: Image file lookup
At runtime you are free to render anything you like, though it is most common to render using raster images packed into a texture atlas, usually using one of the Spine Runtimes plus a game toolkit. Rendering SVG is challenging in general for a number of reasons and most game toolkits can't do it at all.
One solution that is mid-way between rendering SVG geometry directly to the screen and rendering raster images is, at runtime, to determine the sizes the skeletons will be rendered at (eg based on the device resolution) then render the SVGs to raster images (eg with some library like AGG, Anti-Grain Geometry), probably packed into texture atlas pages to reduce draw calls. You can then use that atlas as normal to render with the Spine Runtimes and your game toolkit. This gives you the benefit of SVG (eg small files, rasterized at high quality based on the user's screen size) without complex rendering. Just rendering the SVGs to a texture atlas is quite advanced and will take some effort though. Unfortunately we don't have a solution for that out of the box, but it's something we'd like to provide in the future (likely for Unity/spine-unity).
Kinvert schriebWhat files do you export after everything is animated? Is it JSON?
Spine skeletal data is exported as JSON or binary. Binary is recommended for small size and faster loading. JSON is usually fine for development or to inspect the data. Example exports can be found in the Spine installation folder or here:
spine-runtimes/examples at 3.8
Kinvert schriebDo you have scripts we can put in the DOM and it will animate the character inside the SVG? Or maybe this has to be done in Canvas? Are scripts on CDN?
If your target is to render on a webpage, the Spine Runtime for TypeScript/JavaScript is spine-ts and it has a few "backends" for rendering via canvas, WebGL, THREE.js, or a YouTube-like animation viewer.
spine-runtimes/spine-ts at 3.8
Another option is the popular but third party pixi.js, which uses our spine-ts.
https://www.pixijs.com/
Note there are technical limitations to spine-ts canvas rendering, notably that canvas cannot natively render meshes. Support to do so can be enabled (useTriangleRendering
), but it is relatively slow and may have artifacts depending on the browser. I would suggest using WebGL if canvas cannot meet your needs.
spine-runtimes/spine-ts at 3.8
spine-ts doesn't animate by manipulating the DOM. Instead it does the calculations necessary, then renders textured triangles.