Jump to content

1.16.5 Best way to go about parenting to BipedModel for custom armor model?


Turtledove

Recommended Posts

I've got a model that I've parented to the correct parts of BipedModel properly; i.e. headwear-> head, chest->body, etc:

My item registry:

/**ARMOR*/
    //avalon mail
    public static final RegistryObject<WithernautsArmor> AVALON_MAIL_HELMET = ITEMS.register("avalon_mail_helmet",
            () -> new WithernautsArmor(ArmorMaterial.DIAMOND, EquipmentSlotType.HEAD, "avalon_mail", new AvalonMailArmorModel(0.4f)));
    public static final RegistryObject<WithernautsArmor> AVALON_MAIL_PLATE = ITEMS.register("avalon_mail_plate",
            () -> new WithernautsArmor(ArmorMaterial.DIAMOND, EquipmentSlotType.CHEST, "avalon_mail", new AvalonMailArmorModel(0.4f)));
    public static final RegistryObject<WithernautsArmor> AVALON_MAIL_LEGS = ITEMS.register("avalon_mail_legs",
            () -> new WithernautsArmor(ArmorMaterial.DIAMOND, EquipmentSlotType.LEGS, "avalon_mail", new AvalonMailArmorModel(0.4f)));
    public static final RegistryObject<WithernautsArmor> AVALON_MAIL_FEET = ITEMS.register("avalon_mail_feet",
            () -> new WithernautsArmor(ArmorMaterial.DIAMOND, EquipmentSlotType.FEET, "avalon_mail", new AvalonMailArmorModel(0.4f)));

 

My armor's model:

public AvalonMailArmorModel(float modelSize)
    {
        super(modelSize, 0, 64, 64);
        this.textureWidth = 64;
        this.textureHeight = 64;
        this.am_leg_pivot_r = new ModelRenderer(this, 0, 0);
        this.am_leg_pivot_r.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_leg_pivot_r.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
        this.am_torso_4 = new ModelRenderer(this, 0, 27);
        this.am_torso_4.setRotationPoint(0.0F, 13.0F, 0.0F);
        this.am_torso_4.addBox(-2.0F, -3.0F, -2.5F, 4, 4, 5, 0.0F);
        this.am_shoulder_l_1 = new ModelRenderer(this, 0, 54);
        this.am_shoulder_l_1.mirror = true;
        this.am_shoulder_l_1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_shoulder_l_1.addBox(-1.0F, -2.5F, -3.0F, 5, 4, 6, 0.0F);
        this.am_helm_2 = new ModelRenderer(this, 0, 18);
        this.am_helm_2.setRotationPoint(0.0F, -5.0F, -4.0F);
        this.am_helm_2.addBox(-2.5F, -6.0F, -1.5F, 5, 6, 3, 0.0F);
        this.am_shoulder_r_2 = new ModelRenderer(this, 48, 55);
        this.am_shoulder_r_2.setRotationPoint(-0.5F, 4.0F, 0.0F);
        this.am_shoulder_r_2.addBox(-3.0F, -4.0F, -2.5F, 2, 4, 5, 0.0F);
        this.am_boot_l = new ModelRenderer(this, 36, 8);
        this.am_boot_l.mirror = true;
        this.am_boot_l.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_boot_l.addBox(-2.5F, 7.0F, -2.5F, 5, 5, 5, 0.0F);
        this.am_torso_2 = new ModelRenderer(this, 36, 0);
        this.am_torso_2.mirror = true;
        this.am_torso_2.setRotationPoint(2.25F, 9.0F, -2.0F);
        this.am_torso_2.addBox(-2.0F, -8.0F, 0.0F, 4, 5, 1, 0.0F);
        this.setRotateAngle(am_torso_2, 0.3141592653589793F, -0.5235987755982988F, -0.10471975511965977F);
        this.am_shoulder_r_4 = new ModelRenderer(this, 22, 56);
        this.am_shoulder_r_4.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_shoulder_r_4.addBox(-5.0F, 0.5F, -3.5F, 6, 1, 7, 0.0F);
        this.am_leg_l_2 = new ModelRenderer(this, 28, 28);
        this.am_leg_l_2.mirror = true;
        this.am_leg_l_2.setRotationPoint(0.0F, -2.0F, 0.0F);
        this.am_leg_l_2.addBox(0.0F, 0.0F, -3.5F, 4, 1, 7, 0.0F);
        this.am_shoulder_r_5 = new ModelRenderer(this, 0, 51);
        this.am_shoulder_r_5.setRotationPoint(-4.4F, 1.5F, 0.0F);
        this.am_shoulder_r_5.addBox(-0.5F, -3.0F, -1.0F, 1, 3, 2, 0.0F);
        this.am_torso = new ModelRenderer(this, 0, 36);
        this.am_torso.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_torso.addBox(-4.5F, 0.0F, -2.5F, 9, 10, 5, 0.0F);
        this.am_shoulder_r_1 = new ModelRenderer(this, 0, 54);
        this.am_shoulder_r_1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_shoulder_r_1.addBox(-4.0F, -2.5F, -3.0F, 5, 4, 6, 0.0F);
        this.am_shoulder_l_4 = new ModelRenderer(this, 16, 18);
        this.am_shoulder_l_4.mirror = true;
        this.am_shoulder_l_4.setRotationPoint(0.0F, -2.5F, 0.0F);
        this.am_shoulder_l_4.addBox(0.0F, -2.0F, -3.0F, 1, 2, 6, 0.0F);
        this.am_shoulder_l_6 = new ModelRenderer(this, 0, 51);
        this.am_shoulder_l_6.mirror = true;
        this.am_shoulder_l_6.setRotationPoint(4.4F, 0.5F, 0.0F);
        this.am_shoulder_l_6.addBox(-0.5F, -2.0F, -1.0F, 1, 2, 2, 0.0F);
        this.am_leg_r_1 = new ModelRenderer(this, 28, 36);
        this.am_leg_r_1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_leg_r_1.addBox(-3.0F, -2.0F, -3.0F, 3, 6, 6, 0.0F);
        this.setRotateAngle(am_leg_r_1, 0.0F, 0.0F, 0.17453292519943295F);
        this.am_leg_pivot_l = new ModelRenderer(this, 0, 0);
        this.am_leg_pivot_l.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_leg_pivot_l.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
        this.am_shoulder_l_5 = new ModelRenderer(this, 22, 56);
        this.am_shoulder_l_5.mirror = true;
        this.am_shoulder_l_5.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_shoulder_l_5.addBox(-1.0F, 0.5F, -3.5F, 6, 1, 7, 0.0F);
        this.am_torso_3 = new ModelRenderer(this, 46, 0);
        this.am_torso_3.setRotationPoint(0.0F, 9.0F, -2.5F);
        this.am_torso_3.addBox(-1.0F, -8.0F, -0.5F, 2, 5, 1, 0.0F);
        this.setRotateAngle(am_torso_3, 0.296705972839036F, 0.0F, 0.0F);
        this.am_leg_l_1 = new ModelRenderer(this, 28, 36);
        this.am_leg_l_1.mirror = true;
        this.am_leg_l_1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_leg_l_1.addBox(0.0F, -2.0F, -3.0F, 3, 6, 6, 0.0F);
        this.setRotateAngle(am_leg_l_1, 0.0F, 0.0F, -0.17453292519943295F);
        this.am_shoulder_l_3 = new ModelRenderer(this, 48, 55);
        this.am_shoulder_l_3.mirror = true;
        this.am_shoulder_l_3.setRotationPoint(1.5F, 4.0F, 0.0F);
        this.am_shoulder_l_3.addBox(0.0F, -4.0F, -2.5F, 2, 4, 5, 0.0F);
        this.am_torso_5 = new ModelRenderer(this, 28, 48);
        this.am_torso_5.setRotationPoint(0.0F, 9.0F, -1.0F);
        this.am_torso_5.addBox(-2.0F, -4.0F, -2.0F, 4, 4, 4, 0.0F);
        this.am_leg_r_2 = new ModelRenderer(this, 28, 28);
        this.am_leg_r_2.setRotationPoint(0.0F, -2.0F, 0.0F);
        this.am_leg_r_2.addBox(-4.0F, 0.0F, -3.5F, 4, 1, 7, 0.0F);
        this.am_torso_1 = new ModelRenderer(this, 36, 0);
        this.am_torso_1.setRotationPoint(-2.25F, 9.0F, -2.0F);
        this.am_torso_1.addBox(-2.0F, -8.0F, 0.0F, 4, 5, 1, 0.0F);
        this.setRotateAngle(am_torso_1, 0.3141592653589793F, 0.5235987755982988F, 0.10471975511965977F);
        this.am_helm_1 = new ModelRenderer(this, 0, 0);
        this.am_helm_1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_helm_1.addBox(-4.5F, -9.0F, -4.5F, 9, 9, 9, 0.0F);
        this.am_boot_r = new ModelRenderer(this, 36, 8);
        this.am_boot_r.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.am_boot_r.addBox(-2.5F, 7.0F, -2.5F, 5, 5, 5, 0.0F);
        this.am_shoulder_r_3 = new ModelRenderer(this, 16, 18);
        this.am_shoulder_r_3.setRotationPoint(0.0F, -2.5F, 0.0F);
        this.am_shoulder_r_3.addBox(-1.0F, -2.0F, -3.0F, 1, 2, 6, 0.0F);

        this.bipedHead.addChild(this.am_helm_1);

        this.bipedRightLeg.addChild(this.am_leg_pivot_r);
        this.bipedLeftLeg.addChild(this.am_leg_pivot_l);

        this.bipedRightLeg.addChild(this.am_boot_r);
        this.bipedLeftLeg.addChild(this.am_boot_l);

        this.bipedRightArm.addChild(this.am_shoulder_r_1);
        this.bipedLeftArm.addChild(this.am_shoulder_l_1);

        this.bipedBody.addChild(this.am_torso);


        this.am_torso.addChild(this.am_torso_4);
        this.am_helm_1.addChild(this.am_helm_2);
        this.am_shoulder_r_1.addChild(this.am_shoulder_r_2);
        this.am_torso.addChild(this.am_torso_2);
        this.am_shoulder_r_1.addChild(this.am_shoulder_r_4);
        this.am_leg_l_1.addChild(this.am_leg_l_2);
        this.am_shoulder_r_1.addChild(this.am_shoulder_r_5);
        this.am_shoulder_l_1.addChild(this.am_shoulder_l_4);
        this.am_shoulder_l_1.addChild(this.am_shoulder_l_6);

        this.am_shoulder_l_1.addChild(this.am_shoulder_l_5);
        this.am_torso.addChild(this.am_torso_3);

        this.am_shoulder_l_1.addChild(this.am_shoulder_l_3);
        this.am_torso.addChild(this.am_torso_5);
        this.am_leg_r_1.addChild(this.am_leg_r_2);
        this.am_torso.addChild(this.am_torso_1);
        this.am_shoulder_r_1.addChild(this.am_shoulder_r_3);

        this.am_leg_pivot_r.addChild(this.am_leg_r_1);
        this.am_leg_pivot_l.addChild(this.am_leg_l_1);
    }

However, this is the result when I put on the armor in-game (ignore the missing textures for now, it's intentional)

Wearing ONLY helm. Okay, this is correct.

image.png.b392a749526237919eb0bb68fbb5b5c5.png

 

ONLY chestplate. Correct as well.

image.png.4edeec064568ab6a1a26922329a250cb.png

 

ONLY legging. For some reason, am_torso is rendered as well

image.png.2cd1bbb443fe1d46ee8dec52d2f82f33.png

 

and when I put on the feet, it looks like it's rendering the entire legging because BipedModel doesn't have a group just for feet.

image.png.607ec77c81fd46b1324213f0e03437cb.png

 

What's the cleanest way to do this?

Edited by Turtledove
Link to comment
Share on other sites

1 minute ago, ChampionAsh5357 said:

Well yes, vanilla armor models have two layers. The leggings grab the body and the legs while the boots grab only the legs. You could fix this by splitting your texture in two and draw the second texture only when the equipment slot is the legs.

Whoever at mojang decided on this system needs to be fired

Link to comment
Share on other sites

33 minutes ago, ChampionAsh5357 said:

Well yes, vanilla armor models have two layers. The leggings grab the body and the legs while the boots grab only the legs. You could fix this by splitting your texture in two and draw the second texture only when the equipment slot is the legs.

Wait, I'm getting this weird effect where there's extraneous layers to the model where there shouldn't be.

 

I'm wearing nothing but the helm, and I've temporarily unparented the helm's model to BipedModel's head and the model has no headwear, but this is happening:

image.png.da421bdba955c14dec5a48d206db56cf.png

Link to comment
Share on other sites

10 minutes ago, Turtledove said:

Wait, I'm getting this weird effect where there's extraneous layers to the model where there shouldn't be.

 

I'm wearing nothing but the helm, and I've temporarily unparented the helm's model to BipedModel's head and the model has no headwear, but this is happening:

image.png.da421bdba955c14dec5a48d206db56cf.png

Makes sense, it's using the default biped model which reserves a 64x32 space for the actual armor. So any data drawn within that space will be reflected on the default model.

Link to comment
Share on other sites

Just now, ChampionAsh5357 said:

Makes sense, it's using the default biped model which reserves a 64x32 space for the actual armor. So any data drawn within that space will be reflected on the default model.

Are there any other options besides having all my textures be outside that space? I tried setting the default model's visibility to false:

 

    @OnlyIn(Dist.CLIENT)
    @Nullable
    public <A extends BipedModel<?>> A getArmorModel(LivingEntity LivingEntity, ItemStack itemStack, EquipmentSlotType armorSlot, A _default)
    {
        _default.bipedHeadwear.showModel = false;
        _default.bipedHead.showModel = false;
        _default.bipedBody.showModel = false;
        _default.bipedLeftArm.showModel = false;
        _default.bipedLeftLeg.showModel = false;
        _default.bipedRightArm.showModel = false;
        _default.bipedRightLeg.showModel = false;
        _default.setVisible(false);
        return (A) this.armorModel;
    }

 

and it still looks like this:

image.png.520b8eea0a3c1b4c63c6642a7aa4e05e.png

Link to comment
Share on other sites

1 hour ago, Turtledove said:

Are there any other options besides having all my textures be outside that space? I tried setting the default model's visibility to false:

 

Not without some bipedmodel trickery which is just annoying to do and not really recommended without a decent grasp of the system. Plus, it's the easiest solution.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I've been trying to make a mod pack for the last day or so now and I haven't been able to launch it once even with all mods disabled. It keeps showing up with Exit Code 1. I gave the modpack to a friend to try and it didn't launch on their pc either due to the same exit code, so I'm not entirely certain what the problem is or how to check it in the logs. So far I've attempted: - Changing from forge version 43.3.0 to 43.3.5 - Downloading Java - Disabling mods (both entirely and individually) I have an NVIDIA GeForce GTX 1070 driver, and I haven't tried to uninstall or reinstall it yet because I'm not certain how to and would have to mess anything up further. I have the latest .txt file of the crash report here: [16:24:34] [main/WARN]: Failed to add PDH Counter: \Paging File(_Total)\% Usage, Error code: 0xC0000BB8 [16:24:34] [main/WARN]: Failed to add counter for PDH counter: \Paging File(_Total)\% Usage [16:24:34] [main/WARN]: Disabling further attempts to query Paging File. [16:24:36] [main/WARN]: COM exception: Invalid Query: SELECT PERCENTUSAGE FROM Win32_PerfRawData_PerfOS_PagingFile [16:24:39] [Datafixer Bootstrap/INFO]: 198 Datafixer optimizations took 149 milliseconds [16:24:40] [Render thread/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] [16:24:40] [Render thread/INFO]: Setting user: CatDoodlee [16:24:41] [Render thread/INFO]: Backend library: LWJGL version 3.3.2+13 [16:24:42] [Render thread/INFO]: Reloading ResourceManager: vanilla [16:24:42] [Worker-Main-11/INFO]: Found unifont_all_no_pua-15.1.04.hex, loading [16:24:44] [Render thread/WARN]: Missing sound for event: minecraft:item.goat_horn.play [16:24:44] [Render thread/WARN]: Missing sound for event: minecraft:entity.goat.screaming.horn_break [16:24:44] [Render thread/INFO]: OpenAL initialized on device OpenAL Soft on Speakers (Atrix Wired Elite Headset) [16:24:44] [Render thread/INFO]: Sound engine started [16:24:44] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas [16:24:44] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/signs.png-atlas [16:24:44] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas [16:24:44] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas [16:24:44] [Render thread/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/armor_trims.png-atlas [16:24:44] [Render thread/INFO]: Created: 128x64x4 minecraft:textures/atlas/decorated_pot.png-atlas [16:24:44] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas [16:24:44] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas [16:24:44] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas [16:24:45] [Render thread/WARN]: Shader rendertype_entity_translucent_emissive could not find sampler named Sampler2 in the specified shader program. [16:24:45] [Render thread/INFO]: Created: 512x256x0 minecraft:textures/atlas/particles.png-atlas [16:24:45] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas [16:24:45] [Render thread/INFO]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas [16:24:45] [Render thread/INFO]: Created: 1024x512x0 minecraft:textures/atlas/gui.png-atlas [16:25:41] [Render thread/INFO]: Stopping! any form of help is greatly appreciated ❤️
    • Tanks for answer, I added SleepTight and I removed Modernfix, but it still crashing: new log new crash log
    • Hi, I'm trying to hide specific vanilla effects such as levitation or slow falling from the inventory GUI, but I haven't been able to figure out how to do this. I need this because they are triggered by another effect and I don't need them all showing up. Unfortunately, I don't know of any mods that include this feature, and I couldn't find any documentation on the process. I've already looked into the IClientMobEffectExtensions interface, but I'm uncertain about how to implement it in my own effect, let alone in any existing vanilla effect. Please help I am using Forge 47.2.0. for Minecraft 1.20.1
    • Also wondering how to create these manually.  First time creating a forge server.
  • Topics

×
×
  • Create New...

Important Information

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