Jump to content

[1.9.4] Loading OBJ for a block


OhiraKyou

Recommended Posts

I'm trying to load this OBJ file (961 bytes) from Blender 2.76b and apply it to a block. However, it silently does not render. The block is currently untextured as I want to get the model in the game before worrying about details.

 

In the client's preinit, I use the following:

OBJLoader.INSTANCE.addDomain(DataModInfo.MOD_ID.toLowerCase());
Item precisionLaserTurretItem = Item.getItemFromBlock(ModBlocks.precision_laser_turret);
ModelLoader.setCustomModelResourceLocation(precisionLaserTurretItem, 0,
        new ModelResourceLocation(DataModInfo.MOD_ID.toLowerCase()+
        ":precision_laser_turret_head.obj", "inventory"));

 

Under assets.turtletech.blockstates, I have the following in precision_laser_turret.json:

{
    "forge_marker": 1,
    "defaults": {
        "model": "turtletech:precision_laser_turret_head.obj",
        "uvlock": true
    },
    "variants": {
        "inventory": { "model": "turtletech:precision_laser_turret_head.obj" },

        "facing": {
            "north": {},
            "east": { "y": 90 },
            "south": { "y": 180 },
            "west": { "y": 270 }
        },

        "active": {
            "true": {},
            "false": {}
        },

        "powered": {
            "true": {},
            "false": {}
        }
    }
}

 

And, I have placed precision_laser_turret_head.obj and precision_laser_turret_head.mtl in both assets.turtletech.models.block and assets.turtletech.models.item.

 

I could certainly use some suggestions here and can upload any files necessary.

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.



×
×
  • Create New...

Important Information

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