Wings 3D Development Forum
Existing UVs ... materials and AutoUV - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Interface & Usage (https://www.wings3d.com/forum/forumdisplay.php?fid=3)
+--- Thread: Existing UVs ... materials and AutoUV (/showthread.php?tid=1903)



Existing UVs ... materials and AutoUV - ggaliens - 04-22-2016

Existing UVs ... materials and AutoUV

When I bring in existing UVs into autoUV and it plots them for me ... and appears to assign the background texture ... when I come back out of AutoUV ... it doesn't make a material for me. Ie ... I see what I want in AutoUV window ... but no in geometry window ... because there is no material binding texture to face.

Not sure if this is expected behavior. Maybe system things there with be a material if there are UVs.

Went back to playing with my spherical around Y UVS assignment and was having a rough time remembering how to use it.


RE: Existing UVs ... materials and AutoUV - micheus - 04-22-2016

The material is created when in AutoUV window you use the option Create Texture in the context menu.


RE: Existing UVs ... materials and AutoUV - ggaliens - 04-22-2016

I tried that and I only end up with the image in outliner window ... no material generated ... even after I do create texture.


RE: Existing UVs ... materials and AutoUV - micheus - 04-22-2016

try something simple to see if it works and how it should:
- create a cube (Cube1);
- smooth once [S];
- select the object;
- UVMapping LMB option;
- in the AutoUV Segmenting in the context menu Segment by->Feature Detection;
- again, in the AutoUV Segmenting in the context menu Continue->Unfolding;
- the AutoUV window is displayed and in the Outline window (even without create the texture) you already should see a new material called Cube1_auv and the default image with letters and colours pattern called auvBG;
- after you use the command to create the texture that image uses to be replaced for the new one called Cube1_auv too.

I could repeat this operation in 2.0.3 without problems.


RE: Existing UVs ... materials and AutoUV - ggaliens - 04-22-2016

Yes ... I can add texture and get the material if i generate UVs in the normal fashion.
No problems. Works fine.

What I'm looking for is a way to create an API call that will add any old UVMapping, background texture ... (test pattern) by way of material.

I'm sure if I prob into the IMPORT code ... I can find a way. I would even just have a TEST SPHERE with material and texture already applied in a resources folder. Then I could just do some parts swapping between two ST#st and two We#we and get what I want ... but that would be super hacky (even if user would not know a think about the hack).

Too many steps. I want to make it easier.





RE: Existing UVs ... materials and AutoUV - micheus - 04-22-2016

Well, the UVmap information is assigned to the mesh. The texture is assigned to the material.
You can assign any different image to the diffuse map property of a material to change the texture applied to the object.
Or, you can create another material with its own image assigned to the diffuse map and assign this material to a mesh and get it "dressing" this new material.

It seems something you can automatize.


RE: Existing UVs ... materials and AutoUV - ggaliens - 04-22-2016

Yes ... but reading wings_material.erl

I don't feel like I have any brain-storm yet. When you open the material editor after the fact ... you can see a bitmap attached to "diffuse" channel. But ... I can't see any API call to make it happen.

I dump the materials after mapping a cube by unwrapping (charts)
Code:
1> {2,
{default,[{maps,[]},
           {opengl,[{ambient,{0.7898538076923077,0.8133333333333334,
                              0.6940444444444445,1.0}},
                    {diffuse,{0.7898538076923077,0.8133333333333334,
                              0.6940444444444445,1.0}},
                    {emission,{0.0,0.0,0.0,1.0}},
                    {shininess,0.0},
                    {specular,{0.0,0.0,0.0,1.0}},
                    {vertex_colors,set}]}],
          {'Cube1_auv',[{maps,[{diffuse,0}]},
                        {opengl,[{ambient,{1.0,1.0,1.0,1.0}},
                                 {diffuse,{1.0,1.0,1.0,1.0}},
                                 {emission,{0.0,0.0,0.0,0.0}},
                                 {shininess,1.0},
                                 {specular,{1.0,1.0,1.0,1.0}},
                                 {vertex_colors,ignore}]}],
                       nil,nil},
          nil}}

1>



RE: Existing UVs ... materials and AutoUV - micheus - 04-22-2016

If I'm not wrong...
{'Cube1_auv',[{maps,[{diffuse,0}]},
that value after diffuse is the image ID. In wings_image.erl there are some functions to get the image list and others.


RE: Existing UVs ... materials and AutoUV - ggaliens - 04-22-2016

HMMM. Food for thought. Thanks. I did get it working based on your comment. 1 click done ... planet.