Page 1 of 1

Doesn`t display opacity value from Gimp on the vase model.

Posted: Sat Jan 05, 2019 18:35
by Andrey01
I made vase model and made for this a texture used alpha channel and opacity at 10 value in Gimp. In registration code of this node i set "use_texture_alpha = true". It doesn`t work and nothing changes:
Image

And other like problem: a texture should not touch to faces for flowers where they should be displayed on the top. How do i fix all these issues "use_texture_alpha=true" value to work and not to display texture on flowers faces on the top?

Blender model:
https://ufile.io/nxj3x

Texture:
https://ufile.io/d3j0h

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sat Jan 05, 2019 20:16
by AspireMint
For me it works:
Image

Try to export it as .b3d model and in code put use_texture_alpha = true.
You will need b3dexport script: https://github.com/minetest/B3DExport
Installing: https://blender.stackexchange.com/quest ... nswer-1689

Code for my test node:

Code: Select all

minetest.register_node("vase:vase", {
	description = "glass_vase",
	drawtype = "mesh",
	mesh = "glass_vase.b3d",
	tiles = { "glass_vase.png" },
	groups = {snappy=3},
	use_texture_alpha = true
})
( https://dev.minetest.net/minetest.regis ... ha_Channel )

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sat Jan 05, 2019 21:36
by Gael de Sailly
You have error messages: invalid color: "#COCOCO". I guess you mean #C0C0C0 (with zeros instead of the letter O).

For flowers I don't really see your exact problem, could you show a screenshot?

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sun Jan 06, 2019 11:19
by Hybrid Dog
To me it looks like you try to create vase nodes for many colours for many flowers.
Maybe you add the flower texture to an invisible part of the vase texture and then colorize the result.
https://github.com/minetest/minetest/bl ... 1573-L1600
If so, I'd recommend you to use the node colouring (https://github.com/minetest/minetest/bl ... i.txt#L589) instead of creating many nodes for different colours, and only create an empty vase node and put the flower node one position above it so that you can take and put the flower to and from the vase.

How exactly do you implement the vase?

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Tue Jan 08, 2019 16:13
by Andrey01
AspireMint wrote:For me it works:
Image

Try to export it as .b3d model and in code put use_texture_alpha = true.
You will need b3dexport script: https://github.com/minetest/B3DExport
Installing: https://blender.stackexchange.com/quest ... nswer-1689

Code for my test node:

Code: Select all

minetest.register_node("vase:vase", {
	description = "glass_vase",
	drawtype = "mesh",
	mesh = "glass_vase.b3d",
	tiles = { "glass_vase.png" },
	groups = {snappy=3},
	use_texture_alpha = true
})
( https://dev.minetest.net/minetest.regis ... ha_Channel )
Ok, i`ll try that model exporter!
Gael de Sailly wrote:You have error messages: invalid color: "#COCOCO". I guess you mean #C0C0C0 (with zeros instead of the letter O).

For flowers I don't really see your exact problem, could you show a screenshot?
Problem consists of what i need to lay flowers textures (from mt_game) on the vase texture, but i don`t understand why edges of faces on which i need to lay flowers textures don`t look like transparent, although that part of vase texture is transparent. Why do faces on the top look like opaque on my screenshot above?
Hybrid Dog wrote:To me it looks like you try to create vase nodes for many colours for many flowers.
Maybe you add the flower texture to an invisible part of the vase texture and then colorize the result.
https://github.com/minetest/minetest/bl ... 1573-L1600
If so, I'd recommend you to use the node colouring (https://github.com/minetest/minetest/bl ... i.txt#L589) instead of creating many nodes for different colours, and only create an empty vase node and put the flower node one position above it so that you can take and put the flower to and from the vase.

How exactly do you implement the vase?
i don`t try to create vase nodes for many colours, i just try to make a few vase nodes with different flowers inside them.
Hybrid Dog wrote:How exactly do you implement the vase?

Code: Select all

local flowers_list = {
    name = {"rose", "tulip_black", "tulip", "geranium"},
    desc = {"Rose", "Tulip Black", "Tulip", "Geranium"}
}

minetest.register_node("luxury_decor:glass_vase", {
    description = "Glass Vase",
    visual_scale = 0.5,
    mesh = "glass_vase.obj",
    tiles = {"glass_vase.png"},
    use_texture_alpha = true,
    paramtype = "light",
    paramtype2 = "facedir",
    groups = {choppy = 1.5},
    drawtype = "mesh",
    collision_box = {
        type = "fixed",
        fixed = {
            {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2},
            --[[{-0.65, -0.3, -1.46, 0.65, 1.4, -1.66},
            {-0.65, -0.3, 0.46, 0.65, 1.4, 0.66}]]
        }
    },
    selection_box = {
        type = "fixed",
        fixed = {
            {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}
        }
    },
    sounds = default.node_sound_glass_defaults(),
    on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
        for _, flower in ipairs(flowers_list.name) do
            if "flowers:" .. flower == itemstack:get_name() then
                minetest.remove_node(pos)
                minetest.set_node(pos, {name="luxury_decor:glass_vase_with_"..flower})
            end
        end
    end
})

for ind, f in pairs(flowers_list.name) do
    minetest.register_node("luxury_decor:glass_vase_with_"..f, {
        description = "Glass Vase With " .. flowers_list.desc[ind],
        visual_scale = 0.5,
        mesh = "glass_vase.obj",
        tiles = {"glass_vase.png^flowers_"..f..".png"},
        use_texture_alpha = true,
        paramtype = "light",
        paramtype2 = "facedir",
        drop = {"luxury_decor:glass_vase", "luxury_decor:glass_vase_with_"..f},
        groups = {choppy = 1.5},
        drawtype = "mesh",
        collision_box = {
            type = "fixed",
            fixed = {
                {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2},
            --[[{-0.65, -0.3, -1.46, 0.65, 1.4, -1.66},
            {-0.65, -0.3, 0.46, 0.65, 1.4, 0.66}]]
            }
        },
        selection_box = {
            type = "fixed",
            fixed = {
                {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}
            }
        },
        sounds = default.node_sound_glass_defaults(),
        on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
            for _, flower in ipairs(flowers_list.name) do
                if "flowers:" .. flower == itemstack:get_name() then
                    minetest.remove_node(pos)
                    minetest.set_node(pos, {name="luxury_decor:glass_vase_with_"..flower})
                    itemstack:add_item("luxury_decor:glass_vase")
                    itemstack:add_item("flowers:" .. string.sub(node.name, 29))
                    return itemstack
                end
            end
            
            minetest.remove_node(pos)
            minetest.set_node(pos, {name="luxury_decor:glass_vase"})
            
            itemstack:add_item("flowers:" .. string.sub(node.name, 29))
        end
    })
end
To each: thanks for your replies!

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Tue Jan 08, 2019 16:38
by Andrey01
AspireMint: i installed B3DExporter, but i can not find it in "Add-ons" tab. As i understand in the addons list it should be named "Import-Export: B3DExport", but there`s no that. So is it named?

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Tue Jan 08, 2019 23:33
by AspireMint
"Import-Export: B3D (BLITZEN3D) Model Exporter"
In Add-on tab there is search box, type "b3d". If it is installed you should see it.
Check it and dont forget to Save User Settings. No need to restart blender, you will find it in File>Export...

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Thu Jan 10, 2019 16:53
by Andrey01
AspireMint wrote:"Import-Export: B3D (BLITZEN3D) Model Exporter"
In Add-on tab there is search box, type "b3d". If it is installed you should see it.
Check it and dont forget to Save User Settings. No need to restart blender, you will find it in File>Export...
It doesn`t work for me. I downloaded the file from your source and stayed it unpacked. Then i clicked "Install Add-on from file..." and it did not install anything because i tried to search it in that box. Is this needed to be unpacked?

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Thu Jan 10, 2019 18:56
by AspireMint
Yup, unpack and try again. Blender requires .py files (addons are just Python scripts)

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Fri Jan 11, 2019 15:00
by Hybrid Dog
This is how it looks to me:
Image

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Fri Jan 11, 2019 17:49
by Andrey01
Hybrid Dog wrote:This is how it looks to me:
Image
So it looked for me, too before, but after i exported the blend file to obj in Object Mode it looked properly (in first case i exported it in Edit mode).

AspireMint, thanks for explaining, i`ll try so. I thought i can install the addon that is not unpacked.

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sat Jan 12, 2019 18:16
by Andrey01
AspireMint, it nothing changed when i exported it in b3d:
Image

And also: why is texture on the mesh model not displayed correctly (in my case, on the chair, it has purely brown color):
Image

The texture that i laid on it:
Image

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sat Jan 12, 2019 18:27
by Andrey01
Other question: why does my texture look like on the model in Solid mode correctly, but in Rendered one it looks like just ugly?

In Solid:
Image

In Rendered:
Image

Model:
https://ufile.io/6txun

Texture:
https://ufile.io/nzlbg

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Mon Jan 14, 2019 16:23
by Kippiis
I had the same issue, thanks to Andrey01 it got solved!

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Mon Jan 14, 2019 21:25
by Andrey01
Ok, but may anybody help me with previous problems about which i wrote?

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Thu Feb 21, 2019 21:33
by Andrey01
Can anybody help me and find out why transparency doesn`t apply in minetest? In my case it happens with vase model. In blender it looks like correctly:
Image

But in minetest no:
Image

Question: why does a texture not lay out on this? I tried to include in my code

Code: Select all

use_texture_alpha = true
, but it doesn`t work! It behaves the same way as without.

Again model and texture downloads:
https://ufile.io/x430u
https://ufile.io/5pyp7

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Fri Feb 22, 2019 10:30
by bosapara
Problem can be only by the reason of wrong code of your node

All works perfect, in attach an example

Image

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Fri Feb 22, 2019 19:20
by Andrey01
bosapara wrote:Problem can be only by the reason of wrong code of your node

All works perfect, in attach an example

Image
But what could i write incorrectly in my code? Here`s a code that registers the vase node:

Code: Select all

minetest.register_node("luxury_decor:glass_vase", {
    description = "Glass Vase",
    visual_scale = 0.5,
    mesh = "glass_vase.b3d",
    tiles = {"glass_vase.png"},
    inventory_image = "glass_vase_inv.png",
    use_texture_alpha = true,
    paramtype = "light",
    paramtype2 = "facedir",
    groups = {choppy = 1.5},
    drawtype = "mesh",
    collision_box = {
        type = "fixed",
        fixed = {
            {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2},
            --[[{-0.65, -0.3, -1.46, 0.65, 1.4, -1.66},
            {-0.65, -0.3, 0.46, 0.65, 1.4, 0.66}]]
        }
    },
    selection_box = {
        type = "fixed",
        fixed = {
            {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}
        }
    },
    sounds = default.node_sound_glass_defaults(),
    on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
        for _, flower in ipairs(flowers_list.name) do
            if "flowers:" .. flower == itemstack:get_name() then
                minetest.remove_node(pos)
                minetest.set_node(pos, {name="luxury_decor:glass_vase_with_"..flower})
            end
        end
    end
})
May you expose here your code please for comparing?

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Fri Feb 22, 2019 19:33
by Andrey01
Huh, when i had switched to 0.4.17.1 stable version, it got worked for me (before i used unstable 5.0.0-dev):
Image

Then i will try to compile 5.0.0-rc2 and check whether it will get worked.

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Fri Feb 22, 2019 20:51
by Andrey01
I tried the vase node in 5.0.0-rc2 and it also changed anything : / Really is this bug in minetest?

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sat Feb 23, 2019 00:42
by v-rob
Well, I know that transparent nodes in 5.0 (like my glass_stained mod) seem to work perfectly fine. Strange.

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sat Feb 23, 2019 08:53
by bosapara
Andrey01 wrote: May you expose here your code please for comparing?
Ive publicated my version of node above "node.zip (31.48 KiB)"

Im not sure its good time to use 5.0.0 version.

About 99.9% of players using =< 4.17.1 (for multiplayer)

So in result if we using 5.0.0 for our server - we have empty online.

Re: Doesn`t display opacity value from Gimp on the vase mode

Posted: Sat Feb 23, 2019 11:41
by Andrey01
bosapara wrote:
Andrey01 wrote: May you expose here your code please for comparing?
Ive publicated my version of node above "node.zip (31.48 KiB)"

Im not sure its good time to use 5.0.0 version.

About 99.9% of players using =< 4.17.1 (for multiplayer)

So in result if we using 5.0.0 for our server - we have empty online.
I need to use 5.0.0 because i use Player Meta in my mod that is new feature in minetest. I consider this is a bug in 5.0.0.