Jump to content

[1.9] Composite Models


Notunknown

Recommended Posts

Ok, so I am working on a mod which requires composite models (item models made from a set of sub-models joined together).

 

Now, I am on track for getting a basic composite model which would fit my minimum requirements, but as I do not know enough at the moment about how models (and mostly quads) work, I am asking about some information regarding the power of models.

 

Composite Models MUST have the following:

*MUST be able to be formed from two or more models, the number and type of which are determiend by an input ItemStack. (This I believe I can do.)

 

Composite Models SHOULD have the following:

*SHOULD be able to define arbitrary rotations relative to "base" rotation, which is determined by the model determined by the input ItemStack.

*SHOULD be able to define arbitrary translations relative to "base" translation, which is determined by the model determined by the input ItemStack. (This I believe I can do.)

 

Composite Models MAY have the following:

*MAY be able to define arbitrary scales relative to "base" scale, which is determined by the model determined by the input ItemStack.  (This I believe I can do.)

*MAY be able to define arbitrary rotations, translations and offsets relative to model relative rotation, translation and offset, which is determined by code determined by the input ItemStack.

*MAY be able to specify a simple hierarchy within models, which is used to allow models to share with their parents relative rotation, translation and scale.

 

For example, I might want to have a magical stone. The stone is made of three models, a core, a glyph and a ring. The core is the base model (determines the rotation, translation and scale relative to the hand), the glyph shares its rotation and translation with the core but has twice the scale (causing it to stick out) and the ring has the same translation and scale as the core but is rotated 90° to the core.

 

The stone also gently floats above the players hand following a sine wave (giving it a floating effect), the core and glyph additionally slowly rotate clockwise at the same rate, and the ring rotates counter-clockwise at a faster rate (giving it a spinning effect). When right clicked the entire model would increase in scale, then decrease again, following a simple curve.

 

So, before I waste time trying something which is impossible, which of those requirements are possible and which aren't?

Link to comment
Share on other sites

Okay, so I believe that I have gotten the basic system set up. Just a few questions:

 

1: How can I have a texture stitched into the texture atlas without an associated item or block to go with it (or does it automatically do this with everything in textures/items?)

 

2: How can I load a model without an associated item or block (for components to be used in composite models) (again, does it automatically do this with everything in the models folder?)

 

3: How can I load non-standard data from a model file (for use in composite models, things like relative translation and scales)?

 

Edit: For (2), I basically want to turn a ModelResourceLocation into an IBakedModel. My attempts are failing... :'(

Link to comment
Share on other sites

I was googling to day for some information today regarding ICustomModelLoader and ran across this mod source. The author does some of the things you are asking about. https://github.com/mrtska/slopeandcorner/tree/1.9

A blog page about the tech used: https://mrtska.net/2016/03/use-icustommodelloader-in-minecraft1-9/

 

It does not answer all your questions I'm sure, but I found it interesting.

Link to comment
Share on other sites

Okay, this is really annoying me. Currently I have managed to do it, but it seems really inefficient.

 

ModelLoaderRegistry.getModel(new ResourceLocation(model_location)).bake(new SimpleModelState(ImmutableMap.<IModelPart, TRSRTransformation>of()), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter());

 

I have gotten it to work for models which belong to pre-existing items with this, but when I try to load a model which does not belong to an actual item it returns the default model (the pink/black cube thing)

 

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getModel(model_location);

 

What am I missing? There must be a method that I have simply overlooked...

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am following a tutorial for modding minecraft 1.20.1, and while running the mod with the minecraft of the idea, no errors was present but, when I switched to real minecraft, it started to want a default constructor "public ZeroToAutomation()" instead of the one recomended by the video "public ZeroToAutomation(FMLJavaModLoadingContext context) {...}", and I can't use the default constructor because I need the FMLJavaModLoadingContext to register the blocks and items.   The problem is at: "net/myself/zerotoautomation/ZeroToAutomation.java" the file contains the default constructor, "Logger"s, and the code for the mod the defaut constructor was added after an error requesting it the Loggers was used to see which methods/constructors was used by the Launcher   things that I tried to fix the issue: remove the default constructor, but an error appeared "net.myself.zerotoautomation.ZeroToAutomation.<init>()", and nothing else on the class runs adding an "public static void init()" method, but it changed nothing   The mod files: https://github.com/Matwaua/Zero_To_Automation/tree/not-finished
    • It is an issue/conflict with distanthorizons
    • I have been trying to combat this issue between oculus and embeddium and to no avail... I have already tried a few online tutorials on how to get this working but it doesn't work at all. https://pastebin.com/geQgifjc
    • wow you sound like fun to play with
    • Instale el mod en mi servidor y este se queda iniciando por horas, en la consola me habla de algo de permisos y trate de seguir la ruta que me da pero no existe.   [13:05:32 INFO]: CustomNPC Permissions available: [13:05:32 INFO]: customnpcs.edit.blocks [13:05:32 INFO]: customnpcs.edit.villager [13:05:32 INFO]: customnpcs.global.bank [13:05:32 INFO]: customnpcs.global.dialog [13:05:32 INFO]: customnpcs.global.faction [13:05:32 INFO]: customnpcs.global.linked [13:05:32 INFO]: customnpcs.global.naturalspawn [13:05:32 INFO]: customnpcs.global.playerdata [13:05:32 INFO]: customnpcs.global.quest [13:05:32 INFO]: customnpcs.global.recipe [13:05:32 INFO]: customnpcs.global.transport [13:05:32 INFO]: customnpcs.npc.advanced [13:05:32 INFO]: customnpcs.npc.ai [13:05:32 INFO]: customnpcs.npc.clone [13:05:32 INFO]: customnpcs.npc.create [13:05:32 INFO]: customnpcs.npc.delete [13:05:32 INFO]: customnpcs.npc.display [13:05:32 INFO]: customnpcs.npc.freeze [13:05:32 INFO]: customnpcs.npc.gui [13:05:32 INFO]: customnpcs.npc.inventory [13:05:32 INFO]: customnpcs.npc.reset [13:05:32 INFO]: customnpcs.npc.stats [13:05:32 INFO]: customnpcs.scenes [13:05:32 INFO]: customnpcs.soulstone.all [13:05:32 INFO]: customnpcs.spawner.create [13:05:32 INFO]: customnpcs.spawner.mob [13:05:32 INFO]: customnpcs.tool.mounter [13:05:32 INFO]: customnpcs.tool.nbtbook [13:05:32 INFO]: customnpcs.tool.pather [13:05:32 INFO]: customnpcs.tool.scripter
  • Topics

×
×
  • Create New...

Important Information

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