Import a 3D Model and automatically assign and export animations
TypeScript
toggle a pose
Scott Petrovicb6dc8faa022f
diff --git a/src/create.html b/src/create.htmlindex 7e0dd9e..c93b845 100644--- a/src/create.html+++ b/src/create.html@@ -206,20 +206,19 @@<!-- reference image for people to see example of rig fitting on a model --><div id="skeleton-template-image" class="skeleton-template-image-clickable">- <img class="skeleton-template-image-preview ignore-filters" src="images/icons/zoom.svg" alt="Preview image" width="20" height="20" />+ <span>See bone reference placement</span>+ <img class="skeleton-template-image-preview ignore-filters" src="images/icons/zoom.svg" alt="" width="16" height="16" /></div><!-- posing tips. only shown for the human skeleton -->- <div id="model-pose-instructions">- <p class="model-pose-instructions-heading">Tips</p>- <p>The 3d models work best with a <strong>T-pose</strong> by default (arms straight out to the sides).</p>- <p>Using an <strong>A-pose</strong> model (arms angled down)?</p>+ <details id="model-pose-instructions">+ <summary class="model-pose-instructions-heading">Using A-Pose Character?</summary><ol><li>Set Positioning to <strong>Transform Widget</strong></li><li>Choose the <strong>Rotation</strong> transform</li><li>Select each shoulder / upper arm bone and rotate it down to line up with the arm</li></ol>- </div>+ </details><div style="display: flex; flex-direction: column;">diff --git a/src/lib/processes/edit-skeleton/StepEditSkeleton.ts b/src/lib/processes/edit-skeleton/StepEditSkeleton.tsindex 76bb7ff..f3e613a 100644--- a/src/lib/processes/edit-skeleton/StepEditSkeleton.ts+++ b/src/lib/processes/edit-skeleton/StepEditSkeleton.ts@@ -151,17 +151,8 @@ export class StepEditSkeleton extends EventTarget {// figure out where the template image URL is at from the Rig Configconst rig_config_entry = RigConfig.all.find(entry => entry.skeleton_type === skeleton_type)- // update DOM element background imagethis.dom_template_image = document.getElementById('skeleton-template-image')if (this.dom_template_image !== null && rig_config_entry !== undefined) {- this.dom_template_image.style.width = '250px'- this.dom_template_image.style.height = '220px'- this.dom_template_image.style.backgroundImage = `url(${ rig_config_entry.skeleton_template_image_url })`- this.dom_template_image.style.backgroundSize = 'contain'- this.dom_template_image.style.backgroundRepeat = 'no-repeat'- this.dom_template_image.style.backgroundPosition = 'center'- this.dom_template_image.style.cursor = 'pointer'-// Remove existing click handler to avoid duplicatesthis.dom_template_image.onclick = nulldiff --git a/src/styles.css b/src/styles.cssindex 819daa3..2a2e15c 100644--- a/src/styles.css+++ b/src/styles.css@@ -556,6 +556,11 @@ option {#model-pose-instructions .model-pose-instructions-heading {font-size: 1.1rem;+ cursor: pointer;+}++#model-pose-instructions[open] .model-pose-instructions-heading {+ margin-bottom: 0.5rem;}#model-pose-instructions ol {@@ -1145,7 +1150,13 @@ div.modal-dialog-body p.survey-thank-you {/* Skeleton Template Image Styles */.skeleton-template-image-clickable {- position: relative;+ display: flex;+ align-items: center;+ gap: 6px;+ width: 100%;+ box-sizing: border-box;+ padding: 4px 6px;+ cursor: pointer;transition: border 0.2s ease;border: 2px solid transparent;border-radius: 4px;@@ -1156,12 +1167,8 @@ div.modal-dialog-body p.survey-thank-you {}.skeleton-template-image-preview {- position: absolute;- bottom: 8px;- right: 8px;- background: rgb(0 0 0 / 26%);border-radius: 4px;- padding: 6px;+ padding: 4px;}/* custom message for our desktop application since we will