Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.12.2] Setting model parts as children of other model parts without resizing them

Featured Replies

Posted

Is it possible to add a model part to another model parts child list while keeping its custom scale?

If not is there another way to make this part turn in sync with the other part?

 

My own experience of this, attempting to create babies with enlarged heads for my custom entities, was that I could call poster render method to "connect" the head to the body without making it a child. It would move correctly as if a child model box, but the animation for the scaled box would also be scaled up so the head would animate in an exaggerated fashion compared to the rest of the body and therefore not be completely in sync. It occurred to me to try scaling the animation, but I never actually tried it.

  • Author
On 10/17/2019 at 11:38 PM, salvestrom said:

 

 

Edited by nil
misunderstanding

  • Author
On 10/17/2019 at 11:38 PM, salvestrom said:

I could call poster render method to "connect" the head to the body without making it a child

do you mean setting the model parts rotationPoints and rotationAngles to the parent parts?

On 10/17/2019 at 10:25 AM, nil said:

Is it possible to add a model part to another model parts child list while keeping its custom scale?

I think you can create the part with size values multiplied by (child's custom scale / parent's scale), and then add that part as a child. I haven't done much with entity rendering, though, so keep that in mind.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

6 hours ago, nil said:

do you mean setting the model parts rotationPoints and rotationAngles to the parent parts?

            GlStateManager.pushMatrix();
            
            GlStateManager.scale(0.75F, 0.75F, 0.75F);
            GlStateManager.translate(0, 16.0F * scale, 3 * scale);

            this.lowerbody.postRender(0.0625F);
            this.upperbody.postRender(0.0625F);
            this.neck.postRender(0.0625F);

            this.head1.render(scale);

            GlStateManager.popMatrix();
            GlStateManager.pushMatrix();
            GlStateManager.scalef(0.5F, 0.5F, 0.5F);
            GlStateManager.translatef(0.0F, 24.0F * scale, 0.0F);
            this.lowerbody.render(scale); 
            GlStateManager.popMatrix(); 

The above was being done in the render method of the model class. Note that neck is a child of upperbody which is a child of lower body, but head1 is not a child of the neck.

Although the head will move as the body rotates, this failed because the animations are scaled up with the size of the head, so the head will move in an exaggerated fashion due to things like breathing animations.

  • Author

Both things actually work:

 

Apparently postrendering a part makes the part rendered afterwards "connected" like in salvestroms example, however i'm not having any issues like this:

On 10/25/2019 at 6:07 AM, salvestrom said:

animations are scaled up with the size of the head, so the head will move in an exaggerated fashion due to things like breathing animations.

 

Also you can do this:

On 10/25/2019 at 3:35 AM, SerpentDagger said:

I think you can create the part with size values multiplied by (child's custom scale / parent's scale), and then add that part as a child.

By calling addChild in the render method however it still rescales the part.

Edited by nil

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.