[Solved] model element texture trouble

Post Reply
User avatar
AiTechEye
Member
Posts: 1002
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

[Solved] model element texture trouble

by AiTechEye » Post

Image

testing the new formspec / model element

Code: Select all

"model[0,0;3,3;character_preview;character.b3d;character.png^(default_diamondblock.png^armor_alpha_helmet.png^[makealpha:0,255,0);0,180;false;true;1,31]"
it works fine on players, like number 1 but when im trying to add to the element i just gets the
generateImage(): unbalanced parentheses(extranous '(') while generating texture "character.png^(default_diamondblock.png" error

and the model appears as the number 2, removeing the "(" and ")" it appears in number 3 that also is wrong.

the whole idea of the armor mod is it uses alpha instead of making textures to every single thing


any idea?

Code: Select all

character.png^(default_diamondblock.png^armor_alpha_helmet.png^[makealpha:0,255,0)
helmet alpha
Image

diamond block
Image

skin
Image
Attachments
1.PNG
1.PNG (84.53 KiB) Viewed 1177 times
Last edited by AiTechEye on Fri Jan 01, 2021 19:57, edited 1 time in total.

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

Re: model element texture trouble

by jp » Post

You should use what table.concat(player:get_properties().textures, ",") returns.

User avatar
AiTechEye
Member
Posts: 1002
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: model element texture trouble

by AiTechEye » Post

it doesn't makes difference

User avatar
v-rob
Developer
Posts: 991
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob

Re: model element texture trouble

by v-rob » Post

Another person has reported problems with texture modifiers in model[]. I don't know if it's a model[]-specific problem or if it's a problem with all formspecs. Could you try putting that whole texture in an image[] and see if it has problems like model[]? That should narrow it down some.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

Re: model element texture trouble

by jp » Post

Looks like an issue with model[]. Tested with a flat image[]:

Image

User avatar
AiTechEye
Member
Posts: 1002
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: model element texture trouble

by AiTechEye » Post

i tested image[] & background[] both works fine

User avatar
Krock
Developer
Posts: 4702
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: model element texture trouble

by Krock » Post

The bug is already reported here: https://github.com/minetest/minetest/issues/10614
Nonetheless, how about this? (escaping texture combiners)

Code: Select all

local str = "character.png^(default_diamondblock.png^armor_alpha_helmet.png^[makealpha:0,255,0)"
str = str:gsub("%^%[", "\\%^\\%["):gsub(":", "\\:")

-- "model[0,0;3,3;character_preview;character.b3d;" .. str .. ";0,180;false;true;1,31]"
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
AiTechEye
Member
Posts: 1002
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: model element texture trouble

by AiTechEye » Post

nope

Code: Select all

model[0,0;3,3;character_preview;character.b3d;character.png^(default_diamondblock.png^armor_alpha_helmet.png\^\[makealpha\:0,255,0);0,180;false;true;1,31]
Image
Attachments
1.PNG
1.PNG (5.94 KiB) Viewed 1177 times

sfan5
Moderator
Posts: 4156
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: model element texture trouble

by sfan5 » Post

Core Developer ›› Mods: Mesecons | WorldEdit ›› Luanti builds for Windows

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

Re: model element texture trouble

by jp » Post


User avatar
AiTechEye
Member
Posts: 1002
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: [Solved] model element texture trouble

by AiTechEye » Post

i just noted that it doesn't works without minetest.formspec_escape()

so

local skin = "character.png^(default_diamondblock.png^armor_alpha_helmet.png^[makealpha:0,255,0)"
do not work:
"model[0,0;3,3;character_preview;character.b3d;"..skin..";0,180;false;true;1,31]"
does work:
"model[0,0;3,3;character_preview;character.b3d;"..minetest.formspec_escape(skin)..";0,180;false;true;1,31]"

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

Re: [Solved] model element texture trouble

by jp » Post

AiTechEye wrote:
Sat Jan 02, 2021 20:10
i just noted that it doesn't works without minetest.formspec_escape()
How is this a surprise? There are [ and () in your string.

User avatar
AiTechEye
Member
Posts: 1002
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: [Solved] model element texture trouble

by AiTechEye » Post

because it is something i never used before

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest