Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Add new learn section with video links

Scott Petrovic0f2387cffb43
diff --git a/src/Mesh2MotionEngine.ts b/src/Mesh2MotionEngine.ts
index 91c7c42..ccc9f1e 100644
--- a/src/Mesh2MotionEngine.ts
+++ b/src/Mesh2MotionEngine.ts
@@ -603,4 +603,8 @@ export class Mesh2MotionEngine {
public show_contributors_dialog (): void {
new ModalDialog('Contributors', Generators.get_contributors_list()).show()
}
+
+ public show_learning_resources_dialog (): void {
+ new ModalDialog('Learning Resources', Generators.get_learning_resources_html()).show()
+ }
} // end Mesh2Motion Engine
diff --git a/src/create.html b/src/create.html
index 8b69f04..b052968 100644
--- a/src/create.html
+++ b/src/create.html
@@ -25,11 +25,12 @@
</div>
<div style="display: inline-flex; align-items: center;">
- <a href="https://support.mesh2motion.org" target="_blank"> πŸ’— Support</a>
+ <a href="#" id="learn-link">Learn</a>
+ <a href="#" id="attribution-link">Contributors</a>
+ <a href="https://support.mesh2motion.org" target="_blank">πŸ’—</a>
<a href="https://github.com/scottpetrovic/mesh2motion-app" target="_blank">
<img src="../images/github-white-icon.png" width="24" height="24" alt="GitHub" />
</a>
- <a href="#" id="attribution-link">Contributors</a>
<!-- Theme Toggle -->
<button id="theme-toggle">
diff --git a/src/dialog.css b/src/dialog.css
index b0f0f3c..e512a28 100644
--- a/src/dialog.css
+++ b/src/dialog.css
@@ -17,17 +17,26 @@
padding: 2em;
border-radius: 8px;
box-shadow: 0 2px 16px rgba(0,0,0,0.2);
- max-width: 41rem;
+ max-width: 41rem;
+ max-height: 90vh;
text-align: center;
}
+.modal-dialog-body {
+ max-height: 65vh;
+ overflow-y: auto;
+ padding-right: 0.5rem;
+ background: var(--bg-alternate);
+ border-radius: 5px;
+}
+
.modal-dialog-content p {
margin-bottom: 2rem;
}
.modal-dialog-content h2 {
margin: 0;
- margin-bottom: 3rem;
+ margin-bottom: 2rem;
color: var(--text-primary);
font-size: 2.0rem;
display: block;
@@ -44,4 +53,26 @@
margin-top: 1em;
padding: 0.5em 1.5em;
font-size: 1em;
+}
+
+.learning-resources-content {
+ text-align: left;
+}
+
+.learning-video-list {
+ display: grid;
+ gap: 1.2rem;
+ margin-top: 1rem;
+}
+
+.learning-video-item {
+ border: 1px solid var(--border-color);
+ border-radius: 8px;
+ padding: 0.8rem;
+}
+
+.learning-video-item iframe {
+ width: 100%;
+ aspect-ratio: 16 / 9;
+ border: 0;
}
\ No newline at end of file
diff --git a/src/index.html b/src/index.html
index 3749fcc..48c836d 100644
--- a/src/index.html
+++ b/src/index.html
@@ -29,11 +29,12 @@
</div>
<div style="display: inline-flex; align-items: center;">
- <a href="https://support.mesh2motion.org" target="_blank"> πŸ’— Support</a>
+ <a href="#" id="learn-link">Learn</a>
+ <a href="#" id="attribution-link">Contributors</a>
+ <a href="https://support.mesh2motion.org" target="_blank">πŸ’—</a>
<a href="https://github.com/scottpetrovic/mesh2motion-app" target="_blank">
<img src="../images/github-white-icon.png" width="24" height="24" alt="GitHub" />
</a>
- <a href="#" id="attribution-link">Contributors</a>
<!-- Theme Toggle -->
<button id="theme-toggle">
diff --git a/src/lib/EventListeners.ts b/src/lib/EventListeners.ts
index ea14246..11b89f7 100644
--- a/src/lib/EventListeners.ts
+++ b/src/lib/EventListeners.ts
@@ -40,6 +40,12 @@ export class EventListeners {
this.bootstrap.show_contributors_dialog()
})
+ // Learn link clicking brings up learning resources
+ this.bootstrap.ui.dom_learn_link?.addEventListener('click', (event: MouseEvent) => {
+ event.preventDefault()
+ this.bootstrap.show_learning_resources_dialog()
+ })
+
// listen for view helper changes
document.getElementById('view-control-hitbox')?.addEventListener('pointerdown', (event: PointerEvent) => {
if (this.bootstrap.view_helper.handleClick(event)) {
diff --git a/src/lib/Generators.ts b/src/lib/Generators.ts
index d0f334c..fbadab9 100644
--- a/src/lib/Generators.ts
+++ b/src/lib/Generators.ts
@@ -38,6 +38,49 @@ export class Generators {
`
}
+ static get_learning_resources_html (): string {
+ return `
+ <div class="learning-resources-content">
+ <div class="learning-video-list">
+ <div class="learning-video-item">
+ <a href="https://youtu.be/wea_ZFhY5MM" target="_blank" rel="noopener noreferrer">Mesh2Motion Asset Files and Organization</a>
+ <iframe
+ src="https://www.youtube.com/embed/wea_ZFhY5MM?si=wpiSz2pNjbfmCjXy"
+ title="Mesh2Motion Asset Files and Organization"
+ loading="lazy"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
+ allowfullscreen
+ ></iframe>
+ </div>
+
+
+ <div class="learning-video-item">
+ <a href="https://youtu.be/37jW10Nk8aY" target="_blank" rel="noopener noreferrer">Create and Export Animations with Mesh2Motion and Blender</a>
+ <iframe
+ src="https://www.youtube.com/embed/37jW10Nk8aY?si=EFUSgzuc7Dm555PI"
+ title="Create and Export Animations with Mesh2Motion and Blender"
+ loading="lazy"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
+ allowfullscreen
+ ></iframe>
+ </div>
+
+ <div class="learning-video-item">
+ <a href="https://youtu.be/Zp4F-uL8k2E" target="_blank" rel="noopener noreferrer">Blender Animation Tips for Mesh2Motion</a>
+ <iframe
+ src="https://www.youtube.com/embed/Zp4F-uL8k2E?si=iYZYgTRvVnvg3wJI"
+ title="Blender Animation Tips for Mesh2Motion"
+ loading="lazy"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
+ allowfullscreen
+ ></iframe>
+ </div>
+
+ </div>
+ </div>
+ `
+ }
+
static create_grid_helper (grid_color: number = 0x111155, floor_color: number = 0x4e4e7a): any[] {
// create floor mesh and add to scene to help with shadows
const grid_size: number = 180
diff --git a/src/lib/UI.ts b/src/lib/UI.ts
index f0d37c0..6b64214 100644
--- a/src/lib/UI.ts
+++ b/src/lib/UI.ts
@@ -92,6 +92,7 @@ export class UI {
dom_build_version: HTMLElement | null = null
dom_attribution_link: HTMLAnchorElement | null = null
+ dom_learn_link: HTMLAnchorElement | null = null
private constructor () {
this.initialize_dom_elements()
@@ -202,6 +203,7 @@ export class UI {
this.dom_build_version = document.querySelector('#build-version')
this.dom_attribution_link = document.querySelector('#attribution-link')
+ this.dom_learn_link = document.querySelector('#learn-link')
// UI for exporting the animation
this.dom_export_button_hidden_link = document.querySelector('#download-hidden-link')
diff --git a/src/retarget/index.html b/src/retarget/index.html
index 0e4a1e7..11a7aea 100644
--- a/src/retarget/index.html
+++ b/src/retarget/index.html
@@ -27,11 +27,12 @@
</div>
<div style="display: inline-flex; align-items: center;">
- <a href="https://support.mesh2motion.org" target="_blank"> πŸ’— Support</a>
+ <a href="#" id="learn-link">Learn</a>
+ <a href="#" id="attribution-link">Contributors</a>
+ <a href="https://support.mesh2motion.org" target="_blank">πŸ’—</a>
<a href="https://github.com/scottpetrovic/mesh2motion-app" target="_blank">
<img src="../images/github-white-icon.png" width="24" height="24" alt="GitHub" />
</a>
- <a href="#" id="attribution-link">Contributors</a>
<!-- Theme Toggle -->
<button id="theme-toggle">
diff --git a/src/styles.css b/src/styles.css
index 8c8ef8f..877fe9e 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -74,7 +74,7 @@ nav a, nav span {
align-items: center;
text-decoration: none;
height: var(--navigation-height);
- padding: 0 2rem;
+ padding: 0 1.25rem;
transition: 0.5s all ease;
line-height: 100%;
}