Material Zones
marble
Posts: 7,500
I've just watched a video on using the DAZ Studio Geometry Editor to add material zones but it looks a little cumbersome to me. I've seen comments elsewhere that Blender is better for this task and probably easier too, once the technique is learned. However, I can't seem to find a YouTube video or a tutorial on how to do this in Blender. Specifically one that describes how to export an oblect (e.g. clothing), add or alter material zones and then re-import it back into DAZ Studio.
If anyone can point me to such a tutorial it would be very much appreciated. I often find that I have objects which have a single material zone but several areas where I would like to change the texture independently.
Comments
I bet SickleYield knows how to do this.
I'm sure she does. I bet a lot of people know too but, while I often export OBJ files for making morphs in Blender, I have never done anything with materials or material zones. So I'm sure it will be just a few settings but I suspect they go by different names in the two applications. I'm also a bit nervous of changing the vertices which may have unforeseen effects.
@marble
Export your object from DS as obj with surface names. Surfaces will import into Blender as material slots.
In edit mode, select the faces you want in the new zone, hit the little + button, name the new slot and then hit "Assign".
Hit alt-A to clear the slection and then "Select" to test that it's what you want.
Go back to object mode, and make sure the object is selected.
Export the object, selecting "only selected object" (or whatever it is) and with an eye towards whatever transformations Blender is instructed to do. I don't think you want any transformations. Maybe it'll take a try or two if it wants to scale the object or the left-handed/right-handed business mirrors the object. This is usually fixed by a rotation and scale by a factor of -1.
When you import the object back, the new slot will show up as a surface, which I think is what you wanted.
And note that you are not changing the vertices, you're changing the metadata about the vertices, i.e. what faces belong to what material groups. Their order will remain the same.
Just tried and it works straightforward. Assign materials in blender and export. What doesn't work for you ?
Great, thanks ... I'll give that a try.
So these would be the Export settings?
I hadn't tried it because, well, I'm not as adventurous as I used to be and I prefer to have an idea how to do something before I try it. Quite the opposite to when I was younger and would ignore the manual, never read instructions and just dive in and press buttons. :)
@marble Yes, that looks correct. The most important being that you have "Write Surfaces" checked. That means the correct "usemtl" directives get written into the obj file, and Blender will thus know what the existing materials slots are, and what faces belong to which. Conversely, you'll check the "Material Groups" checkbox under the Include tab when exporting from Blender so DS will in turn know what material zones to create upon import back.
Is there a way to save these new material zones (like morphs are saved as a Support Asset)? Or are they permanent once created?
If you want to have versions of the figure with both the original and the new zones then you need to save as an asset, with a new name. If you just want a choice of which to use, with only one version in any given scene, save a Scene, Scene Subset, or Character Preset (in the latter case make sure you use it to load a new figure, not to modify a selected figure).
Thanks Richard although let me try to understand this in my own words (sorry, I just like to be clear). When you say "asset" you mean as a figure/prop asset, being careful not to overwrite the original (asset name)? Otherwise I can just close the scene and the new zones will not be saved. But if I want to reload that scene with that object having those modified material zones, I can save in the usual ways that I save scenes (or Character presets).
Yes, that is right.
Thanks y'all. :)
So I tried this method and have not been able to import the new material zones.
I tried with a simple clothing object (panties) and selected a loop around the leg holes to be a zone for a trim. All seemed to be going well but on import back to DAZ Studio, no new material zones were there. Here's a screen shot of the Blender export settings:
Ah wait - I think I have it. I think I need to click "Assign". Also, I think the new zones need to be selected as I export. Right?
@marble I think you are still "throwing out the manual"... :)
In edit mode, select the faces you want in the new zone, hit the little + button, name the new slot and then hit "Assign".
Hit alt-A to clear the slection and then "Select" to test that it's what you want.
Perhaps either Blender noticed that there were no faces in them and didn't write the new slots out, or DS realized it and didn't bother to create empty groups.
You don't need to select the material slots, only make sure that you have the "Material Groups" checkbox checked.
And I urge you to open the obj file with a text editor and see what it's doing. It'll remove the arcana of the whole thing and you'll truly understand what it is that is happening.
I must have read your post 3 or 4 times and I still managed to miss-read the "Assign" bit. I think my mind skips ahead sometimes.
When I went back and tried selecting was when I realised the Blender was still not recognising them as new zones. I think I had tried Assign but, as you instruct, the polygons need to be selected. I just didn't have my ducks in a row. Anyhow, I managed to get it done eventually and learned something more about Blender in the process so all is good.