Page 1 of 2

[fixed] several materials to a mesh

PostPosted: Sunday, 13.May 2012, 17:16
by ikam
Skinnytorus wrote:In order to apply several materials to a mesh, first apply one base material to the entire mesh and then apply other materials to respective selections.
If you, say, logically divide a mesh in 2 selections and then try to apply 2 different materials to both of them, crash is imminent after you apply the second material :))


Hi Skinnytorus

you right there is a bug, see .wz4 example below.

I've made a quick correction in code and it works, but it's a bit brutal and not a very correct way. need investigations.

In file wz4_mesh.cpp line 4248

replace
sVERIFY(!cl->Geo[geoindex]);
by
if(cl->Geo[geoindex] != 0) break;

Instead of printing a debug message and break wz4 because something is wrong (Geo[geoindex] different than 0), it just ignore and continue silently...

Re: [bug] several materials to a mesh

PostPosted: Sunday, 13.May 2012, 20:48
by Skinnytorus
hi, ikam.
it looks like you're one of those c++ gurus :)) thanks for the quick fix.
once you are finished with the final code maybe you could submit a pull request to ryg at https://github.com/farbrausch/fr_public?
it would be nice to have it as an official fix :)

Re: [bug] several materials to a mesh

PostPosted: Monday, 14.May 2012, 08:18
by reEto
hey guys...

there is NO BUG in the wz4 materials. the example files are not up to date. this means along the years the tool changed, and the example file fits perfect to another tool version. if you want to apply a material, first select the shadertype (phong, etc) the tex2d, tex2d sor. the sort of tex. you can also use phong by tex, but not often used this time.

Re: [bug] several materials to a mesh

PostPosted: Monday, 14.May 2012, 09:00
by Skinnytorus
reEto
Please, submit an example file so we could see better what you mean. Thanks.

Re: [bug] several materials to a mesh

PostPosted: Monday, 14.May 2012, 11:14
by reEto
the example file added in the public release is about 3 years old. its for internal testing, not used as tut :). there are no bugs in there, just the used tool for this example was another. we never updated the older pages... (on the bottom). if we do another op or stuff like that then another page will be added.

you can "update" the example file (to the public release) page by page. some of the stuff in there is not working because of missing files through our FR svn, but most of it still ok, still cool to learn. :)

Re: [bug] several materials to a mesh

PostPosted: Monday, 14.May 2012, 13:47
by Skinnytorus
reEto
I guess we have some misunderstanding here. ;)
I'm well aware of the example file. The crash I'm talking about happens in any wz4 file I create (I also doubt that the test file provided by ikam is taken from example.wz4).
The described crash happens on simple materials as well as on MOD ones. What I meant in my last post was: 'can you provide an example of working combination of 2 materials
without a 'background' material?' Sorry if I misguided you. ;)

Re: [bug] several materials to a mesh

PostPosted: Tuesday, 15.May 2012, 07:16
by reEto
hey,

if you want to add 2 textures to mesh, simple use the AUX op to combine them. bye texture you can give them your selection, the upper & lower half defines tex1 & tex2, and tadddaaaa... your mesh got 2 faced textured :)

Re: [bug] several materials to a mesh

PostPosted: Tuesday, 15.May 2012, 13:09
by ikam
reEto

i didn't succeed to use AUX as you said, and didnt' find any suitable example in /data. Could you post an example here, please ?
Thks.

Re: [bug] several materials to a mesh

PostPosted: Tuesday, 15.May 2012, 20:50
by Skinnytorus
Me neither. Please, post your example file.

Re: [bug] several materials to a mesh

PostPosted: Wednesday, 16.May 2012, 06:40
by ikam
lilttle parenthesis

reEto wrote:you can "update" the example file (to the public release) page by page. some of the stuff in there is not working because of missing files through our FR svn, but most of it still ok, still cool to learn. :)


How to deal with wz3 num version, and example file too ?
For example when I push a commit to github, do I need increment wz3 num version in my commit ?

thks lot ;)

Re: [bug] several materials to a mesh

PostPosted: Saturday, 09.June 2012, 17:12
by reEto
i tested several tex to one mesh on Cube. i can not find any bugs? hm. second time everyone called it "BUG", but learn to stack the right way, define your clusters, do not think too complicate, then most of your "bugs" are gone. we have several years tested the tool, so there are no really hard import. bugs in there :)
no bug.PNG

Re: [bug] several materials to a mesh

PostPosted: Saturday, 09.June 2012, 22:34
by ikam
Take a look to the file attached in the first post. When there is many SimpleMaterial superposed on the same faces, wz crash.

The goal here is not to superpose textures on the mesh but if I want for example apply a texture on some specific faces (selected with Select op) and apply another texture on an another faces region (with select also) if this second selection touch the previous selection, wz will crash.

Maybe it's a wrong way to apply differents textures on differents selected faces but the wz crash is maybe strong and could be avoided.

Could you share your file to show how you did it ?

thanks

Re: [bug] several materials to a mesh

PostPosted: Sunday, 10.June 2012, 13:00
by Skinnytorus
yes, i second that.
to repro this 'bug':
0. make a primitive or import an object.
1. make a face selection and apply a material to it.
2. make another selection by inverting the first selection.
3. apply some other material to the second (inverted) selection.
4. show the last op.
5. Crash...

Re: [bug] several materials to a mesh

PostPosted: Sunday, 10.June 2012, 13:51
by reEto
use cluster to avoid crashes :)

Re: [bug] several materials to a mesh

PostPosted: Sunday, 10.June 2012, 14:16
by Skinnytorus
I thought cluster select mode was used to select slices of a split mesh from their index.
how do we mark a cluster in a mesh without splitting it?