KatsBits Community

Game Editing => IMVU Creator Community => Topic started by: Jhaeza on June 21, 2017, 10:08:12 PM

Title: [imvu] Using UV map as texture
Post by: Jhaeza on June 21, 2017, 10:08:12 PM
Hello guys,

This is my first post on here and I created a pillow as a seat and use bevel on it.
I created a UV map and my first question would be, how I can make it look like the one I created on 3DS Max. Somehow the one from 3DS Max looks more clean and isn't green.

Plus, how can I use this UV map as a texture on Blender and IMVU?
So that, when I fill the parts it really just fits the mesh. I used "flatten mapping" in 3DS Max and is there a good option for Blender, too (which is that simple)?

Blender UV Map:
(https://i.gyazo.com/176a16b3ef0712e1694c967a053c7ce2.png)

3DS Max:
(https://i.gyazo.com/34930737c375ecc07232132d137c6fe5.png)
Title: Re: [imvu] Using UV map as texture
Post by: kat on June 21, 2017, 10:35:07 PM
Blender colour tints UV's based on Material assignments to the mesh. To 'clear' that, select the mesh Object and then in "Material" Properties left-click the "Diffuse" colour sample (will be green). A colour-picker will appear. Left-click the centre of the wheel, or left-click drag each of the "R", "G" and "B" values to "1.000". This sets the Material colour to 'white'.

With the mesh selected in Edit Mode to expose the UV's, in the UV/Image Editor click the "UV's" menu item in the Header, then "Export UV Layout". This open the File Browser/Export window. Bottom-left are the "Export UV Layout" options. Change "Fill Opacity:" to "0.00". This forces Blender to export just the wireframe. If that image is opened in an image-editor it's then possible to change the background to suit.

Quote
Design note: if the UV is not mapped to a placeholder image it defaults to being 1024x1024 when exported (this can be adjusted in the options mentioned above).

Once the Wireframe image is available as an image itself - saved as a PNG or other format - its loaded into Blender and used just like any other image; assigned to a Material, then mapped to a UV.
Title: same material
Post by: Jhaeza on June 21, 2017, 11:44:37 PM
@kat: Thank you, I was able to do it like that and it finally worked. I copied that pillow, so that I have two now and they share the same material. When I upload my mesh to IMVU, the second (copied) pillow stays with a white texture, though.

What is the problem right there?


(https://i.gyazo.com/3ca3459cd536d4d891491ff4bf90d9da.png)


Title: Re: [imvu] Using UV map as texture
Post by: kat on June 22, 2017, 12:04:48 AM
What do the Material assignments look like in Create Mode? Are there two slots or just one?

If there are two, the second slot will need the same image assigned to it as IMVU treats each independently from other slots, even when the same image is used multiple times (subject to set-up in Blender). If there is just the one slot make sure the duplicate uses the same Material and Texture assignment in Blender before export - white usually means there's a Material issue.
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on June 23, 2017, 07:56:11 AM
There are two slots in create mode and I added the same texture as you said and the result is what I actually want, I mean, that they share the same texture.
But I'd like to have one material slot, which works for both of the pillows. Since the pillows are the same (mesh, texture and UV), I'd like to use only one slot for both. So when I change something, it appears on both of the pillows.

How can I do that? I guess, it would be something in Blender, right?
(https://i.gyazo.com/7a2f0eceab86862f1bba35411f27e956.png)
Title: Re: [imvu] Using UV map as texture
Post by: kat on June 23, 2017, 08:17:24 AM
That generally happens, i.e., using separate textures, when the meshes are either; 1) separate (individual meshes), or 2) have separate material assignments in Blender. If it's the former, "1)", join the two meshes together in Blender and export as a single unit - when imported into IMVU that should only pull in a single XMF. If its the latter, "2)", make sure both elements use the same Material and texture assignment in Blender (note that the way IMVU works with Materials now [XRF files now longer needed] both mesh elements may need to be joined together anyway - each texture assignment in IMVU is unique unless xrf files are used [IMVU assigns textures rather than materials when xrf is disabled]).
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on June 23, 2017, 08:25:17 AM
Hmm, to be honest I don't really know which of those is my problem. I just dragged & dropped a texture from my Explorer on Windows into Blender and on the mesh I want it on. When I go to that little material icon, I can't see mine. And in object mode I right-clicked both of the pillows and pressed CTRL+J. And saved it like that.

Oh, I have another question: I duplicated the nodes I already have for the second pillow. I couldn't export this, though. How can I add a second spot for the pillow right next to the first one?

Also thank you, that you are helping me out so well. I really don't know what I'd do without your help on this.  ;D
Title: Re: [imvu] Using UV map as texture
Post by: kat on June 23, 2017, 08:20:40 PM
When the mesh is imported into Create Mode are you loading two separate XMF files or just one?

Regards to the drag-n-dropping the *image*: that sounds like Blender is assigning the image directly to the objects UV map, if you drag the texture in twice it may have created two unique instances of the same asset. This is also why Material Properties is blank; you'll need to create a proper Material reference with Texture and Image slots (https://www.katsbits.com/tutorials/blender/learning-materials-textures-images.php) (the drag-n-dropped bitmap is associated with the latter). You can then assign that one Material to both meshes.

Regards the nodes: extra seat nodes need to be joined to the primary Armature of the item. Right-click select the Armature you want to join to something then the Armature you want this joined to (this must always be selected last), and press "Ctrl+J" to "Join". This physically joins the Armature together so the result can be exported as a larger unit.
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on June 24, 2017, 09:08:17 AM
I could finally upload one material for both of the pillows, thank you. I assigned that one material to both meshes, like you said.

But when I add the second nodes, my avatar just stands in the pillow. How can I solve that?

(https://i.gyazo.com/fd047dd9a05cd5ea9133e6b33051b7e8.png)
(https://i.gyazo.com/2f21cd912b94ebb46181d78461f7f053.png)
(https://i.gyazo.com/f56c63a886163e64907d01c7ae4501ca.png)
Title: Re: [imvu] Using UV map as texture
Post by: kat on June 24, 2017, 09:22:33 AM
The names attributed to the second set of bones need amending, they should be numbered "seat02.Sitting" etc., with the ".001" removed - each 'set' of nodes need to be incrementally numbered (this is for rooms but the numbering schematic applies to furniture (https://www.katsbits.com/tutorials/imvu/make-rooms-armatures.php#seatnumbering)).
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on June 24, 2017, 10:20:33 PM
Thank you, that worked as well!

Now, if I let's say want to add legs to this. I could just form it how I want it to be and would CTRL+J it to the pillows and that would be done? Or would I have to do the same steps as shown here by you: https://www.youtube.com/watch?v=U6Oj5hqPar4&t=947s?

Title: Re: [imvu] Using UV map as texture
Post by: kat on June 24, 2017, 11:10:06 PM
It's easier to extrude from what you already have, that way you only worry about the structure being added and not other things - joining meshes could throw the Origin Point out of alignment for example.
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on June 24, 2017, 11:26:07 PM
But I can still have differents materials for the extruded parts in IMVU?
Title: Re: [imvu] Using UV map as texture
Post by: kat on June 25, 2017, 01:34:01 AM
Yes, you just need to assign different Materials to the new sections AND map a different image to their respective UV's - https://www.katsbits.com/tutorials/blender/learning-multiple-materials-textures-images.php
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on June 28, 2017, 12:18:22 PM
I have this feeling like this is way more complicated for me. I can't really form the extruded parts how I want to.
If I wanted to make it like I told earlier, by uploading a few meshes (not merged), how would that work? Just, that I can try it out at least.
Title: Re: [imvu] Using UV map as texture
Post by: kat on June 28, 2017, 01:56:59 PM
When making items from multiple meshes just treat each as a separate furniture item.

In other words if those cushions were essentially the tops of padded boxes, the 'box' part would be built using the same principles used to make the cushions, i.e. the mesh is vertex grouped to the "root" bone of the same armature used by the 'seat' part. At export two meshes would then be exported rather than just the original.

In Create Mode this then simple requires adding another mesh element in "meshes" (click the "+ Add" button top-left of the section). This new component is then treated then same as any other.
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on July 11, 2017, 08:17:43 AM
Thank you,

I could finally understand it. I got a new problem, though. I don't know why I even got this. When I first used bevel, the edges worked perfectly. Now I can't really round them off.

This was my first try:

(https://i.gyazo.com/057e41c4c03c0ae76c6c315f2ba68cc9.png)


Now I get this:

(https://i.gyazo.com/0dae245be149b99553287e5bf3afd660.png)
Title: Re: [imvu] Using UV map as texture
Post by: kat on July 11, 2017, 10:58:33 AM
That looks like Bevel is being applied to a scaled Object. To fix: in Object mode make sure to use "Apply" ("Ctrl+A") to reset to the mesh before using Bevel otherwise the results tend to skew like that.
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on July 12, 2017, 04:40:39 PM
Oh, so it was that simple.  :o
My two meshes share the same texture now, though. I change the first one with the pillows and the second mesh changes, too.
I unwrapped the second mesh and used a different "test-material" from the ones you provided. What did I do wrong here?
Title: Re: [imvu] Using UV map as texture
Post by: kat on July 12, 2017, 05:41:52 PM
If that happens it generally means the two meshes are linked duplicates. Select on of them and then press "U". From the "Make Single User" menu that appears click "Object & Data" or "Object & Data & Material+Tex" to create a unique instance for the Material and Texture slots as per what you'll need to do anyway.
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on July 13, 2017, 07:44:06 AM
That worked, thank you.
In my second mesh tab, I can also see the material used in the first tab. Can I somehow change that? So, that only one material is listed (the grey one)?

(https://i.gyazo.com/d8765ad6dd7321da520a83b74ec6d2a5.png)
Title: Re: [imvu] Using UV map as texture
Post by: kat on July 13, 2017, 09:39:37 AM
Is that in any way associated with the mesh, i.e. its not part of the model? If so go into the "assets" tab.. it should be there as a highlighted entrey. If it is, it can be deleted by selecting it and clicking "Remove". That can be used generally to get rid of any unused or redundant assets in the file (ones not linked to anything).
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on July 13, 2017, 06:11:33 PM
There's nothing highlighted. Both of the textures are listed on both of the material lists for each of the meshes. So it something, that can't be changed?
Title: Re: [imvu] Using UV map as texture
Post by: kat on July 13, 2017, 06:21:42 PM
It should be possible to forcibly remove it using the "assets" inspector, just select it to highlight then click "Remove".
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on July 13, 2017, 06:37:35 PM
So this is my list of materials in the assets:

(https://i.gyazo.com/13a46fdf9fdfef78ca06408573bc4f4d.png)

When I delete one, this happens:

(https://i.gyazo.com/e983d434a341d7fe266c625fd9e51fe8.png)
Title: Re: [imvu] Using UV map as texture
Post by: kat on July 13, 2017, 07:09:33 PM
So the grey one should cover the entire mesh? In Blender make sure you remove any unwanted Materials, if both sections use the same image but you have two Materials assigned you'll typically end up with what you're showing above. Consolidate and make sure you have one Material per texture if you want the single texture instance in IMVU.
Title: Re: [imvu] Using UV map as texture
Post by: Jhaeza on July 13, 2017, 07:47:24 PM
I wanted to export two meshes from blender, which worked: the pillows and the "big pillow" beneath. The pillows share one texture and the "big one" is the grey texture on the material list.
I have two mesh tabs in create mode but I somehow see the texture of the pillows in the material list of my "big pillow". But the big one only has one and I don't know, why the pillows list shows the grey one of the big pillow beneath and why the big one shows the texture of the little pillows in it's own material list.

I changed the colors now to explain myself a bit better.

(https://i.gyazo.com/4271acc58c33edcd59e46eb815c34626.png)

This is the tab of the little pillows and the material list also shows up the green texture:

(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fi66.tinypic.com%2F2mcghfo.jpg&hash=ba3f1a6cb1b7ad7c9e277813c46244f9bf062f82)

This is the tab of the big pillow and the material list also shows up the pink texture:

(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fi63.tinypic.com%2F2usd8hl.jpg&hash=cf70540c7d49b42792d4becb4ab92e4acf9ed25d)

What I mean is, that the materials are duplicated and can be found in the other mesh tab, too. But the second mesh only includes the big pillows and the first mesh only the little ones.
So why does the create mode show me both textures on both mesh tabs? So, that the pink big pillow only has the pink material/texture listed in its tab.


Title: Re: [imvu] Using UV map as texture
Post by: kat on July 14, 2017, 02:32:07 PM
Right but are you exporting this =/=, both upper and lower included per 'left' or 'right' side exported. Or this --/--, top and bottom sections exported separately regardless of left/right? If it's the first there will be texture sharing, if it's the latter make sure each top and bottom mesh have a single Material assignment in Blender (they should each have only their respective Material and image assignment).

Note you may also need to enable "XRF" Materials for greater control in Create Mode - click "Settings" then "Create", activate "Turn on Material & Texture name editing".


Scratch all of that as it looks like IMVU has changed the way that works... it looks like all the textures associated with a given project are included regardless of the number of meshes loaded into Create Mode. In other words, they're not listed per-mesh, but instead per-project - I just tested this on a simple mesh and found the same problem occurring, the unwanted images don't appear in "assets" for them to be removed -- I know this never used to be the case as I have some live projects set up using multiple meshes and they don't exhibit this problem... or at least I don't remember them doing so. Looks like you might be stick with this.

[EDIT] after a bit more investigation... it is possible to remove the unused Material in Create Mode but it requires a bit of messing about. To remove;

Step 1
- Derive product as normal
- Select each Material and set the XRF selector to the blank option at the very top of the list.
- Apply Changes.
- Set the XMF selector to the blank entry at the top of the mesh list.
- Apply Changes.

This should force the default/original item to disappear in the main view.

Step 2
- Add an initial mesh object.
- Add the associated Materials (XRF) and images.

Step 3
- In the "Debug" tab under "Debug 01" the current assets will be shown.
- Under "Material" select the "TextureMap[n]" entry that should be there and "Delete".
- Apply Changes.
- Add any extra XMF (and associated XRF) files.
- Apply Changes.

This doesn't change the texture association, it just removes the unwanted references