[fixed] several materials to a mesh

[fixed] several materials to a mesh

Postby ikam » Sunday, 13.May 2012, 17:16

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...
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: [bug] several materials to a mesh

Postby Skinnytorus » Sunday, 13.May 2012, 20:48

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 :)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: [bug] several materials to a mesh

Postby reEto » Monday, 14.May 2012, 08:18

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.
Image
User avatar
reEto
Autosplineversteher
Autosplineversteher
 
Posts: 74
Joined: Monday, 14.December 2009, 18:20

Re: [bug] several materials to a mesh

Postby Skinnytorus » Monday, 14.May 2012, 09:00

reEto
Please, submit an example file so we could see better what you mean. Thanks.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: [bug] several materials to a mesh

Postby reEto » Monday, 14.May 2012, 11:14

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. :)
Image
User avatar
reEto
Autosplineversteher
Autosplineversteher
 
Posts: 74
Joined: Monday, 14.December 2009, 18:20

Re: [bug] several materials to a mesh

Postby Skinnytorus » Monday, 14.May 2012, 13:47

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. ;)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: [bug] several materials to a mesh

Postby reEto » Tuesday, 15.May 2012, 07:16

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 :)
Image
User avatar
reEto
Autosplineversteher
Autosplineversteher
 
Posts: 74
Joined: Monday, 14.December 2009, 18:20

Re: [bug] several materials to a mesh

Postby ikam » Tuesday, 15.May 2012, 13:09

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.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: [bug] several materials to a mesh

Postby Skinnytorus » Tuesday, 15.May 2012, 20:50

Me neither. Please, post your example file.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: [bug] several materials to a mesh

Postby ikam » Wednesday, 16.May 2012, 06:40

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 ;)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: [bug] several materials to a mesh

Postby reEto » Saturday, 09.June 2012, 17:12

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
You do not have the required permissions to view the files attached to this post.
Image
User avatar
reEto
Autosplineversteher
Autosplineversteher
 
Posts: 74
Joined: Monday, 14.December 2009, 18:20

Re: [bug] several materials to a mesh

Postby ikam » Saturday, 09.June 2012, 22:34

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
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: [bug] several materials to a mesh

Postby Skinnytorus » Sunday, 10.June 2012, 13:00

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...
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: [bug] several materials to a mesh

Postby reEto » Sunday, 10.June 2012, 13:51

use cluster to avoid crashes :)
You do not have the required permissions to view the files attached to this post.
Image
User avatar
reEto
Autosplineversteher
Autosplineversteher
 
Posts: 74
Joined: Monday, 14.December 2009, 18:20

Re: [bug] several materials to a mesh

Postby Skinnytorus » Sunday, 10.June 2012, 14:16

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?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46


Return to Bug reports



Who is online

Users browsing this forum: No registered users and 1 guest

cron