Jump to content

How to create a base model for use with multiple different models?


Recommended Posts

Posted

Sorry, I'm kind of dreadful at .json, so please bear with me.

So, I have it so I need to move the position of the item model, but otherwise its a regular item model.

{
  "parent": "item/handheld",
  "textures": {
    "layer0": "matchlockguns:items/matchlock_gun"
  },
  "display": {
    "thirdperson_righthand": {
      "rotation": [ 0, -90, 55 ],
      "translation": [ 0, 1, 0.5 ],
      "scale": [ 0.85, 0.85, 0.85 ]
    },
    "thirdperson_lefthand": {
      "rotation": [ 0, 90, -55 ],
      "translation": [ 0, 1, 0.5 ],
      "scale": [ 0.85, 0.85, 0.85 ]
    },
    "firstperson_righthand": {
      "rotation": [ 0, -90, 25 ],
      "translation": [ 1.13, 3.2, 1.13 ],
      "scale": [ 0.68, 0.68, 0.68 ]
    },
    "firstperson_lefthand": {
      "rotation": [ 0, 90, -25 ],
      "translation": [ 1.13, 3.2, 1.13 ],
      "scale": [ 0.68, 0.68, 0.68 ]
    }
  }
}

However, basically all of my items use this configuration of transforms, so I was woundering how I would go about creating a basic .json model, and then have all my items use it as a substrate, only replacing the texture per for each model. I've tried things like having a model like that and then making the items use it as a parent, but it simply makes them null boxes. I've also been unable to find copies of the item/handheld or item/generated models.

Posted

For context. This is what i've tried:

 

baseModel.json

{
  "parent": "item/handheld",
  "display": {
    "thirdperson_righthand": {
      "rotation": [ 0, -90, 55 ],
      "translation": [ 0, 1, 0.5 ],
      "scale": [ 0.85, 0.85, 0.85 ]
    },
    "thirdperson_lefthand": {
      "rotation": [ 0, 90, -55 ],
      "translation": [ 0, 1, 0.5 ],
      "scale": [ 0.85, 0.85, 0.85 ]
    },
    "firstperson_righthand": {
      "rotation": [ 0, -90, 25 ],
      "translation": [ 1.13, 3.2, 1.13 ],
      "scale": [ 0.68, 0.68, 0.68 ]
    },
    "firstperson_lefthand": {
      "rotation": [ 0, 90, -25 ],
      "translation": [ 1.13, 3.2, 1.13 ],
      "scale": [ 0.68, 0.68, 0.68 ]
    }
  }
}

 

othermodel.json

{
  "parent": "matchlockguns:item/baseModel",
  "textures": {
    "layer0": "matchlockguns:items/flintlock_musket"
  }
}

 

Posted
15 minutes ago, Beethoven92 said:

"parent": "matchlockguns:item/baseModel"

You are using invalid characters in your json file name, don't use capital letters

Thank you so much. This solved the issue. Just goes to show my lack of knowledge of the .json models and such.

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.

Announcements



×
×
  • Create New...

Important Information

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