#is there an extrusion tool or something for blockbench?

93 messages · Page 1 of 1 (latest)

zealous elbowBOT
#
Welcome to the help forum!

Please make sure to read #1029373817119838218 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

pulsar dust
#

!faq texture-to-3D

zealous elbowBOT
# pulsar dust !faq texture-to-3D
FAQ
Blockbench: Texture To 3D

Depending on where you wanna have the model there are different ways to turn a texture into a (default-item like) model:
java 1. Letting the game generate it from a texture (vanilla Java)
bedrock 2. Directly adding a new item (Bedrock Edition)
blockbench 3. Letting Blockbench generate it (ONLY use this if the other options are not applicable!!!)

** java 1. Letting the game generate it from a texture:**
Create a .json file somewhere inside your models folder and put this code inside of it:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "custom/example"
  }
}``` This will tell the game to generate a model based on the texture `YourPack/assets/minecraft/textures/custom/example.png`.
(Use `item/handheld` as parent instead if you want it to be held like a weapon).

It can be used just like any other model, so you can either replace an existing item with it or "add" it with custom_model_data. You can also load it into Blockbench to edit the display settings.

** ![bedrock](https://cdn.discordapp.com/emojis/526419810272149526.webp?size=128 "bedrock") 2. Directly adding a new item in Bedrock Edition:**
Please follow the steps described in here:
Default like items: <https://wiki.bedrock.dev/items/items-intro.html>
Custom 3D model items: <https://wiki.bedrock.dev/items/3d-items.html>

** ![blockbench](https://cdn.discordapp.com/emojis/340506781111549957.webp?size=128 "blockbench") 3. Generating it in Blockbench:**
ONLY use this approach if you plan on editing it more than what the other option allows you to do!!!
You need to make sure to use per-face uv (_not_ box-uv!) and then do `File > Import > Extruded Image` and select your texture. Then, pick the way it should generate the texture. You can chose between pixel by pixel, line by line (horizontal/vertical) or in as little chunks as possible (area). 
I suggest to always use area for performance. If you wanna edit each pixel/line choose one of the other options.
pulsar dust
#

I'd suggest Method 1

simple fern
pulsar dust
#

You can load that into Blockbench and adjust the display settings without "hardcoding" the shape to the texture (so you can easily adjust the texture without needing to adjust the model later)

#

Textures not being 16x16 is not a problem in general.

simple fern
#

any way for me to get the extruded image to scale the cubes and not the entire model?

#

like im trying to make it bigger but its not working

pulsar dust
simple fern
#

just a way to make it bigger cause i need to see how it scales

pulsar dust
#

try method one and scaling it in the display settings and see if that's large enough for you

simple fern
#

i cant really try method one rn since my laptop is completely dead

pulsar dust
#

Should be like 2.5 blocks long afaik with that method

simple fern
#

like the reason i want to make it in blockbench directly is so that when my laptop is recharged i have models ready to continue my mod

pulsar dust
#

Method 1 is a model that can be used in a mod just fine
In fact, most mods use Method 1 (unless they get into ridiciolous sizes)

simple fern
#

wait there was a way to make a group into 1 object right?

pulsar dust
#

not with cube elements

simple fern
#

well is there a way to unite it into 1 object?

pulsar dust
#

If you turn it into a mesh, yeah.
But then you can't use it ingame (and it doesn't really give you an upside).

simple fern
#

there has to be another way tho

pulsar dust
#

why do you need it to be one object?

simple fern
#

to scale it in a decent way without distorting all the cubes

#

this happens if i scale it normally

pulsar dust
simple fern
#

im on my desktop

pulsar dust
#

then try Method 1 on your Desktop?

simple fern
#

id rather do it in blockbench for the display feature

pulsar dust
#

you can use any text editor for that

#

literally "Notepad" works for this

simple fern
#

so just save the texture as a json with the json script that was written here?

#

the item/generated?

pulsar dust
#

yeah

simple fern
#

well how would i run the .json

pulsar dust
#

Notepad

#

.json are just text files

simple fern
#

yeah

#

just like

#

notepad has a run feature?

#

thats something i didnt know

pulsar dust
#

you aint running a .json file

#

it's not an executeable

simple fern
#

sorry

pulsar dust
#

it's a .json file like any other Minecraft model

simple fern
#

i mean like it generates stuff

pulsar dust
#

and you use it exactly like any other minecraft model

simple fern
#

so then just import the .json into blockbench

pulsar dust
#

That parent tells the game to generate a model from the texture.
You can also use it in Blockbench and Blockbench will visually generate it just like ingame.

#

-# (Blockbench will use a mesh for that that you are not allowed to edit (besides display settings ofc))

simple fern
#

do i need to save the texture in a model folder in minecraft or can i just make a folder in my root and then make the texture there

pulsar dust
#

the texture and the model file need to be inside a resource pack like you'd need to do for any other model

simple fern
#

and what would the directory be like

pulsar dust
#

usually
assets/minecraft/models/item/
assets/minecraft/textures/item/

But you can ofc adjust the namespace folder (minecraft) or have other or more folders than "item" if you wish to do so.
-# For textures you'd need to keep the texture within the item or block folders or add the location to a special file to tell the game that it is allowed to load textures from there

simple fern
#

so i just have to make something in intellij

#

because i dont have an example resource pack

#

ima see

pulsar dust
#

you don't need intellij to create folders ...

simple fern
#

just folders work i thought i needed all the assets of mc

#

where does the resourcepack folder need to be located?

{
"parent": "item/generated",
"textures": {resourcepack/assets/minecraft/textures/custom/scythe_texture.png,
"layer0": "custom/example"
}
}

this is what i did

#

does it need to be in .minecraft?

#

or can it just stay in a random folder

simple fern
#

nvm texture broke

pulsar dust
pulsar dust
pulsar dust
simple fern
#

welp i accidentally made the resolution of my texture 64x64 so now it looks stupid

pulsar dust
#

what do you mean by "looks stupid"?

simple fern
#

have a look yourself

#

its too small

#

dammit

#

itgot destroyed

pulsar dust
#

that's a 32x64 texture

#

why did you resize it 🤔 ?

simple fern
#

because im stupid

#

anyways i remade a texture

#

thats 128x128

#

{
"parent": "item/generated",
"textures": {
"layer0": "custom/scythe"
}
}
this is whats in the .json btw

#

how will it generate the .json

pulsar dust
simple fern
#

im stupid

#

so is that correct?

pulsar dust
#

It will generate the model internally when the pack is loading.
It wil never generate another file from that if that was your idea.

Yes, this is correct

#

load that into Blockbench to adjust display settings

#

though if you use textures/custom you will need to do this:

#

!faq texture-atlas

zealous elbowBOT
# pulsar dust !faq texture-atlas
FAQ
Java: Texture Atlas

General Information:
The game creates a "texture atlas" (combination of all textures into one file) for block/item models.
For performance reasons as of Java 1.19.3 the game by default only loads textures from within textures/item and textures/block (and any folders within those two folders) into that atlas instead of reading through every model for the relevant textures.

_________________________

Making the game load from custom directories
If you want the game to add textures from other directories (that are still somewhere within the "textures" folder) to that atlas you will need to create a blocks.json file in YourPack/assets/minecraft/atlases:

Example blocks.json

{
    "sources": [
        {
            "type": "directory",
            "source": "custom",
            "prefix": "custom/"
        }
    ]
}```
This example would make the game add _all_ textures that are within `textures/custom` to the atlas. This **even** applies to images that are not used by your models, so keep your pack clean for better performance and smaller size!.

**_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_**

**Additional/more specific information**:
If you have several custom directories you can add several json objects in the "sources" list/array.
blocks.json's of different packs combine btw, so you don't need to worry that one pack will stop another pack from loading their textures.

Here is also an example pack from a Minecraft dev (boq) with some more specific examples (like only using the face part of the default pig texture instead of loading all entity textures or the whole pig texture): <https://cdn.discordapp.com/attachments/593812273164976166/1042452631743901756/sprites.zip>

The official blog post with the changes (you will have to scroll down quite a bit for the relevant information): <https://www.minecraft.net/en-us/article/minecraft-snapshot-22w46a>
simple fern
#

alright yk what nvm, i have no clue how to do this resourcepack bs, ill find another way