Results 1 to 17 of 17
  1. #1

    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.Click image for larger version. 

Name:	TransparentMaterialinCyclesHow.png 
Views:	27 
Size:	268.1 KB 
ID:	486983



  2. #2
    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



  3. #3
    Ok thanks smilebags. Any idea how to do that? I'm not seeing the + under the texture tab anymore..
    Last edited by Alternicity; 08-Jun-17 at 13:07.



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



  5. #5
    Click image for larger version. 

Name:	NodeAaargh.png 
Views:	13 
Size:	297.6 KB 
ID:	488267 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?



  6. #6
    Member JA12's Avatar
    Join Date
    Apr 2012
    Posts
    4,454
    Originally Posted by Alternicity View Post
    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.
    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.

    Click image for larger version. 

Name:	screen.png 
Views:	10 
Size:	278.1 KB 
ID:	488309
    Simplified version of https://blenderartists.org/forum/sho...=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.

    3. 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

    Click image for larger version. 

Name:	screen2.png 
Views:	7 
Size:	322.3 KB 
ID:	488321
    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
    Last edited by JA12; 19-Jun-17 at 11:43.
    New to BA.org and have a support question? Here's how to do that more effectively.



  7. #7
    Click image for larger version. 

Name:	Originalhuman skin mat.png 
Views:	14 
Size:	176.5 KB 
ID:	488853Ok 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)


    Click image for larger version. 

Name:	SmallerUV to Material Node.png 
Views:	11 
Size:	274.1 KB 
ID:	488855
    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?



  8. #8
    Member JA12's Avatar
    Join Date
    Apr 2012
    Posts
    4,454
    Originally Posted by Alternicity View Post
    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?
    Whichever you want

    Originally Posted by Alternicity View Post
    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?
    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

    Click image for larger version. 

Name:	screen1.png 
Views:	13 
Size:	516.8 KB 
ID:	488882
    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.

    Click image for larger version. 

Name:	screen2.png 
Views:	8 
Size:	511.4 KB 
ID:	488884
    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.
    Last edited by JA12; 12-Jul-17 at 05:19.
    New to BA.org and have a support question? Here's how to do that more effectively.



  9. #9
    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*

    Click image for larger version. 

Name:	MissingVertexGroups.png 
Views:	10 
Size:	402.9 KB 
ID:	488991



  10. #10
    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..



  11. #11
    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: Click image for larger version. 

Name:	matprob.png 
Views:	10 
Size:	785.4 KB 
ID:	488992



  12. #12
    The recovered file makes the mat go white: Click image for larger version. 

Name:	whiteMateProb.png 
Views:	10 
Size:	651.4 KB 
ID:	488994
    Last edited by Alternicity; 25-Jun-17 at 05:19. Reason: Overwrote a duplicate post



  13. #13
    Member JA12's Avatar
    Join Date
    Apr 2012
    Posts
    4,454
    Originally Posted by Alternicity View Post
    Can you tell me what is going on here
    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.
    Last edited by JA12; 25-Jun-17 at 10:12.
    New to BA.org and have a support question? Here's how to do that more effectively.



  14. #14
    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.



  15. #15
    Result!

    Any pointers on how to make it look better?

    Thanks for looking.
    Click image for larger version. 

Name:	1.png 
Views:	7 
Size:	1.14 MB 
ID:	491005

    Click image for larger version. 

Name:	2.png 
Views:	8 
Size:	591.3 KB 
ID:	491006

    Click image for larger version. 

Name:	3.png 
Views:	7 
Size:	375.3 KB 
ID:	491007



  16. #16



  17. #17
    Click image for larger version. 

Name:	shot4.jpg 
Views:	4 
Size:	131.9 KB 
ID:	492871

    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?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •