How to animate a section of mesh to slowly go transparent in cycles

Hello,

I am trying to render a character’s arm such that a section of the arm skin gradually becomes transparent.
I know about vertex groups but not much about cycles and the node editor.

I was thinking that I would need to duplicate the skin material and apply the duplicate to that section, then figure out animated transparency for it with nodes.

My questions are:
Is this the best way to go about this?
Will it mess the UV’s up? (The character is a ManuelBastoniLab char)

When I try to duplicate the material, the new material ( with appended .001 ) seems to overwrite the existing one, so basically how do I duplicate a material correctly?

Thanks for reading.


What you probably want to do instead is create a texture (like the skin texture) and paint in what you want to go transparent. Then use a mix node in cycles with that texture as the factor

Ok thanks smilebags. Any idea how to do that? I’m not seeing the + under the texture tab anymore…

Ok nevermind that last, I made a copy through the UV editor. Fiddling with it now.


Ok created that texture - can someone tell me how to add it? I don’t seem to be able to right now. Am I even in the right place inside blender?

If you assign that new material to the mesh, yes, but Cycles doesn’t mix materials like Blender render material nodes do, if you’re used to those.
Cycles also doesn’t support texture node tree. All textures in it go to material nodes.


Simplified version of https://blenderartists.org/forum/showthread.php?317070-How-to-mix-2-diffuse-textures-with-alpha-so-the-transition-is-smooth&p=2511102&viewfull=1#post2511102

  1. Material node tree
  2. Mixing diffuse and transparent shaders with mix shader node. Don’t confuse mix shader node with mix rgb node. Mix shader only mixes shaders, mix rgb mixes colors, and shaders with green socket only connect to other green sockets without exceptions.

The setup is simple, I just made it complicated. The framed part is a texture. You could replace that with an image texture if you wanted to, or you could animate the value on the mix shader without connecting a texture.

What my texture does there is take the coordinates from an empty object, rotate and offset them so I can show the empty, and then create a greyscale gradient from top down. It then controls the factor of the shaders where 0 (black) is diffuse, 1 (white) is transparent, and values in between is a mix of the two. But, with the setup the position of the texture can be controlled with the empty in the viewport.

  1. If the model has many layers or light goes through many bounces before getting in the transparent bits, might need to increase transparency bounces in render settings


If you want to use a texture but keep the texture in place, could animate the transparency by controlling the greyscale values. In this one I made the gradient very small with color ramp and then

  1. added a math node, changed it to multiply mode, enabled clamp, and
  2. added keyframes to the lower field.

What this does is multiply the values on the gradient with the value in the lower field, and clamp keeps values in 0-1 range even if you multiply with values outside that. Multiplying white (1) with 0 gives 0 and the whole thing is visible. Multiplying black (0) part with 0.5 gives 0, and 1*0.5 = 0.5, the top part is half transparent.

So when animated, one gets this


Ok thanks for your time.
Couple of questions, if you don’t mind:

I added the nodes, but they seems to be in a new material - is this correct or should I be adding them the the MBlab_human_skin material already present? (pictured here, it’s quite big)


How do I get the vertex group for the transparency section or the UV map of same (second picture) to be present in the Texture Coordinate node?

Whichever you want

There are ways to mask the right area but vertex groups isn’t one of them.

If you want the transparent material to look like the original, the easiest way is to make a duplicate of the original material, assign that duplicate material to the correct mesh faces, then add the nodes for the animated transparency.

If you want to add it to the original material, then there’s the problem of masking it. Could paint a mask texture map, use a separate UV map, or could use vertex colors to paint the mask in. I’ll show the latter two


Original on the left, masked part in the middle, result on the right. I made an additional UV map and moved UV’s that belong to the left side outside the UV area. UV = XY so when I dragged them left, they got negative X values. Could then get that UV map and find negative X values to use as a mask. What I forgot from that is to add another math node for animating the transparency.


With vertex colors I went to vertex paint, enabled face mask, selected the faces and filled the other side with black. Shift+K to fill.

Similar but simpler node setup because the color itself is adequate to work with. Added math node that can be used to animate the transparency by adding keyframes to the lower field.

Thanks again JA12 - I will keep tweaking.

Somehow or other all the vertex groups but one got deleted…I don’t suppose you know how to get thos back, or what might have happened there? I certainly didn’t go through them manually deleting them. scratches head


Ok the vertex groups appear to still be present in the autosave, thank goodness.
I’d still like to know how they disappeared, but for now - phew…

Aargh what a mess. No sooner do I get the vertex groups back from the autosave, than something goes screwy with the materials.
Can you tell me what is going on here:


The recovered file makes the mat go white:


No. The screenshots aren’t enough to know what is set and what happens because of those.

I can only guess that the selected faces get selected in the material list, and the selected material has no nodes so it renders as black. If it’s assigned to everything, it would also render as black. But the shown render result is a composite, which means it goes through post-processing, so it’s either result from compositor or video sequence editor and might be altered from the result from the render engine.

Ok thanks for your help. I think I’ll delete the file and start again from scratch - if the vertex groups are all deleted, bar one, on top of the material problem, I think it will be easier.

Result!

Any pointers on how to make it look better?

Thanks for looking.





Render.


I’ve got the animated transparency working, and this is basically the effect I was looking for. The next few frames will zoom in further and start to show things even closer up. Just thought I’d throw this up here to see if anyone had any crits. Does the arm need to be internally lit for instance?