extend "stack shells" to normal materials

Issue #1316 new
Alessandro Padovani created an issue

daz studio 4.15.0.30, blender 3.4.0, diffemorphic 1.7.0.1332

This is related to #1295 but reported here for better handling.

The idea is that most geografts have a base material copied from the figure, plus a shell to blend the geograft material with the base material. For multiple geografts, if the base material is the same then the shells could be stacked, so to have a single material for all the geografts. We could extend the "stack shells" option for udims to the "merge materials" tool.

note. Please note that different geografts will have different uv maps for the base material, so those uv maps need to be merged first, otherwise it is not possible to merge base materials with different uv maps.

note. As noted in #1295, merging a geograft causes its uv map to map the entire figure with zero uvs, because blender doesn't allow to uv map only a part of an object. For this reason we have to mask out all the zero uvs of a merged uv map.

note. Please note that some shells may have displacement and some not, so we may need to activate displacement for the base material when we stack shells. Or we could also set displacement for all materials by default, so to always support displacement if there's any.

steps:

  1. merge geografts with fix and merge uvs
  2. merge materials with stack shells
# stack shells
for all materials
    if there's a shell
        find the base material and check that the uv map is the same
        assign the base material to the shell geometry
        stack the shell to the base material and mask out the zero uvs
        delete the shell material

EXAMPLE.

1. merge geografts. Here we take as example G8F with golden palace and headlights by Meipe, test scene included gphl.duf. First we import the scene and merge rigs. Then we merge the geografts with the fix and merge uvs options, this is needed so we can merge materials that are the same but have different uvs, as it happens for geografts.

note. If we extend "stack shells" to normal materials, then the fix and merge uv options are needed both for normal and udim materials, so we may rename the “udim materials” label as “stack shells“ since this is what the options are needed for.

2. merge materials. The next step is to merge materials. This will merge all the materials with the same attributes, but will leave out those with different shells.

3. merge base materials. Now we stack the headlight shell. First we assign the "torso" material to "nipples" that's the headlight material, so we go to edit mode, select the geometry for "nipples", and assign "torso". This merges the base material for headlight.

4. stack shell. Then we copy and paste the headlight shell to the torso material and mask out the zero uvs. Then we also activate displacement for “torso” since headlights is using it.

note. The zero uvs mask can be embedded in the shell same as udims in #1295.

5. final. We do the same for golden palace.

note. Please note that golden palace gets two shell materials, this must be a bug since I copied "torso" to "torso-back" in daz studio to be the same material. Please Thomas if you can check.

Comments (5)

  1. Alessandro Padovani reporter

    note. The above long description is probably not needed since I suppose the “stack shells“ option for udims in #1295 already does all of that. It is there just in case it can be useful and also to describe how we can do this by hand.

    note. This procedure is good even for a single geograft since the shell will be stacked to its base material.

  2. Alessandro Padovani reporter

    note. important. See #1295 for full example with NGV8.

    Stack shells has limits. That is, if the shell gets multiple materials then we have to choose one, because multiple shell materials will not work fine with stack shells. This usually is not a big issue because a single material per shell is doable for most geografts. So if the shell gets multiple materials we need to merge them before stacking shells.

  3. Thomas Larsson repo owner

    I had a look at this and realize that I have forgotten about shell stacking. Anyway, the reason that the torso and torso-back materials are not merged is that the top coat max value for the shells differ.

  4. Alessandro Padovani reporter

    Thank you for looking into this.

    Limits are not a material property and they should not be taken into account when merging materials. What matters is the current value that’s the same.

  5. Log in to comment