MCprep icon indicating copy to clipboard operation
MCprep copied to clipboard

Cannot swap texture pack using jmc2obj

Open PiporGames opened this issue 6 months ago • 12 comments

Did the issue happen after restarting Blender?

  • [x] Yes, the issue indeed continued after restarting Blender

Check known issues

  • [x] I have checked known issues, and my problem is different

What happened?

When using jmc2obj, trying to change a texture pack with normals/specular errors out with "Detected scaled UV's (all in one texture), be sure to use Mineway's 'Export Individual Textures To..'' feature". This happens when exporting all textures + specular/normal, all textures, and no textures (and also + alpha/textures in separate files). Well, every possible combination.

When using one object only the texture pack does not apply. When using objects per material, the texture pack applies but not the normals/specular.

What steps are needed to produce the bug?

  1. Generate one of the few combinations tested in jmc2obj
  2. Open new blender file
  3. Import obj in the jmc2obj tab.
  4. Immediately press swap texture pack, selecting either Specular or SEUS.
  5. Plain textures are applied, but not specular/normal data.

What version of MCprep are you using?

3.6.1.2

What version of Blender are you using?

4.2.3 LTS

PiporGames avatar Jun 06 '25 15:06 PiporGames

Can you open the OBJ in a text editor and copy-paste from COMMON_MC_OBJ_START to COMMON_MC_OBJ_END?

StandingPadAnimations avatar Jun 06 '25 16:06 StandingPadAnimations

And in addition, can you state what version of jmc2OBJ you're using? Maybe this is the result of a new update?

StandingPadAnimations avatar Jun 06 '25 16:06 StandingPadAnimations

# COMMON_MC_OBJ_START
# version: 1
# exporter: jmc2obj
# world_name: world
# world_path: C:\Users\pipor\Desktop\SSMP PLF\world
# export_bounds_min: (859, 30, -2793)
# export_bounds_max: (1330, 319, -2408)
# export_offset: (-1095.000000, -30.000000, 2600.000000)
# block_scale: 1.000000
# block_origin_offset: (-0.5, -0.5, -0.5)
# z_up: false
# texture_type: INDIVIDUAL_TILES
# has_split_blocks: true
# COMMON_MC_OBJ_END

jmc2OBJ: jMc2Obj-127.jar

PiporGames avatar Jun 06 '25 20:06 PiporGames

I'm unable to recreate this issue on my end. Is there anything I'm missing in my attempt to reproduce?:

  1. Export from jmc2OBJ with default settings (which seems to be one of the combinations you mentioned)
  2. Import the OBJ through MCprep's OBJ World Input
  3. Swap texture pack with a labPBR-enabled resoure pack (specifcally this one, for Minecraft 1.21.5)
  4. Prep materials afterwards with the SEUS option (this can also be done in the file dialog in the swap operator)

While some materials are missing the extra maps, others aren't, which I assume is just based on what the resource pack supports.

The error message you're getting is a bit weird, given the CommonMCOBJ header for your OBJ file has texture_type defined as INDIVIDUAL_TILES, which shouldn't trigger the scaled UVs message (maybe you're importing through the regular Blender OBJ importer and not though MCprep?)

StandingPadAnimations avatar Jun 07 '25 03:06 StandingPadAnimations

Followed the instructions and the same happens. Here are all the details:

Image

Image

# COMMON_MC_OBJ_START
# version: 1
# exporter: jmc2obj
# world_name: world
# world_path: C:\Users\pipor\Desktop\SSMP PLF\world
# export_bounds_min: (859, 30, -2793)
# export_bounds_max: (1330, 319, -2408)
# export_offset: (-1095.000000, -30.000000, 2600.000000)
# block_scale: 1.000000
# block_origin_offset: (-0.5, -0.5, -0.5)
# z_up: false
# texture_type: INDIVIDUAL_TILES
# has_split_blocks: true
# COMMON_MC_OBJ_END

Image

Image

PiporGames avatar Jun 07 '25 11:06 PiporGames

What do the UVs for the OBJ look like?

StandingPadAnimations avatar Jun 07 '25 22:06 StandingPadAnimations

I'm not too familiarized with the UV view, i'm guessing there are a lot of files, one for each texture. I can provide the files if you want to check them out by yourself. Maybe that way we can pinpoint where the problem is coming from. Image

PiporGames avatar Jun 07 '25 23:06 PiporGames

I've find that the texture that causes the problem (which stops the whole texture swap operation) is minecraft_block-pink_petals_stem. Replacing every texture besides this one makes it work I think.

PiporGames avatar Jun 08 '25 16:06 PiporGames

Can you send the following files:

  • OBJ with issue
  • MTL file
  • tex folder created by jmc2OBJ (same folder as the OBJ)
  • Blend file (if possible), with all resources packed

Ideally put them in a zip file

StandingPadAnimations avatar Jun 09 '25 20:06 StandingPadAnimations

Here is the ZIP file: https://drive.google.com/file/d/1komX4dR81o_hGEBBq-cnHv2U-Hn73vM2/view?usp=sharing

PiporGames avatar Jun 11 '25 11:06 PiporGames

Ok, so it looks like the OBJ file you exported has something weird with the model where MCprep thinks the textures are scaled. I've attempted to create a new OBJ using the same exact export settings, and I'm unable to reproduce this. I suspect there's some combination of factors that makes MCprep think the UVs are scaled for a texture atlas.

I'll mark this as a bug for now

StandingPadAnimations avatar Jun 12 '25 00:06 StandingPadAnimations

Alright, to reduce confusion, I've opened up #662 as a patch for the UV warning, which is incorrect based on the texture_type value in the CommonMCOBJ header your OBJ has.

StandingPadAnimations avatar Jun 12 '25 06:06 StandingPadAnimations

Thanks for taking the time! As a side note, I want to bring back again the sort-of fix I found,

I've find that the texture that causes the problem (which stops the whole texture swap operation) is minecraft_block-pink_petals_stem. Replacing every texture besides this one makes it work I think.

Replacing every other material besides that one seem to work as a temporal workaround. I've been looking around and it seems that same texture is causing problems in other bug reports.

PiporGames avatar Jun 12 '25 16:06 PiporGames

I believe the patch should resolve that anyway. Maybe that's what's causing MCprep to think the UVs are scaled?

StandingPadAnimations avatar Jun 14 '25 07:06 StandingPadAnimations

Closing as fixed in #662, I'm hoping we can get a new release by the end of the year (though I've been uploading some builds on the MCprep server and my website, though note they are unofficial)

StandingPadAnimations avatar Aug 31 '25 05:08 StandingPadAnimations