C4DLounge.eu - Cinema 4D Gebruikers Forum  

Go Back   C4DLounge.eu - Cinema 4D Gebruikers Forum > Beginner hoekje - Beginner Corner > Beginners forum

Reply
 
Thread Tools Display Modes
  #1  
Old 16th August 2019
GeeVee GeeVee is offline
Junior Member
 
Join Date: Feb 2011
Location: Groningen (NL)
Posts: 8
Default Turn displacement in previewing

I often work with displacements in my models which slow down the previewing process significantly.
When I'm working on other aspects of the model (no displacement involved), I wish there was a way to turn off all displacements in all materials (temporarily) when previewing my work.

At the moment I manually turn of displacement in the different materials, but I often forget to turn on one or the other in the final renderings. Another possibility is hiding the parts involved, but that also isn't handy in a lot of cases.

Someone out there with a bright solution ??
Reply With Quote
  #2  
Old 16th August 2019
Cinemike's Avatar
Cinemike Cinemike is offline
Senior Member
 
Join Date: Jan 2012
Location: Deepest Saxony, Germany
Posts: 670
Default

You could, for example, put all materials with displacement in a layer together and before the final render multi-select them and check the displacement channel.
You could do the same with XPresso, but it would not really be much more comfortable than the manual solution.
You could wait for somebody who knows Python better than me to write you a script.
__________________
Cinema4D R20 & VrayforC4D 3.7
Reply With Quote
  #3  
Old 17th August 2019
GeeVee GeeVee is offline
Junior Member
 
Join Date: Feb 2011
Location: Groningen (NL)
Posts: 8
Default

Thanks Cinemike, that's a useful "first step" towards an "ultimate solution"
Reply With Quote
  #4  
Old 17th August 2019
Cinemike's Avatar
Cinemike Cinemike is offline
Senior Member
 
Join Date: Jan 2012
Location: Deepest Saxony, Germany
Posts: 670
Default

Well, if you happen to use the internal renderers of C4D, you could also create two render settings, one called "test" and one called "final" and switch off "Sub Polygon Displacement" in the Options tab of "test".

Chances are you are using an external renderer, though Corona does not have such options for the render settings, Vray does. Don't know about the rest.

You'd still have to remember to switch settings for the final rendering
__________________
Cinema4D R20 & VrayforC4D 3.7

Last edited by Cinemike; 17th August 2019 at 14:48.
Reply With Quote
  #5  
Old 17th August 2019
GeeVee GeeVee is offline
Junior Member
 
Join Date: Feb 2011
Location: Groningen (NL)
Posts: 8
Default

That'll work for me. For the final renderings, I always use different settings.
Now I only need to make two default test settings; one with and one without "spd".

Great help, thanks again Cinemike
Reply With Quote
  #6  
Old 17th August 2019
Cinemike's Avatar
Cinemike Cinemike is offline
Senior Member
 
Join Date: Jan 2012
Location: Deepest Saxony, Germany
Posts: 670
Default

Glad I could help!
__________________
Cinema4D R20 & VrayforC4D 3.7
Reply With Quote
  #7  
Old 3 Weeks Ago
pgrooff pgrooff is offline
Senior Member
 
Join Date: Aug 2009
Posts: 879
Default

Here 2 very very simple python scripts to turn displacement on or off.

Very simple, because only c4d materials are supported (not tested on other external renderers like vray) and because previous state is not kept.
So, setting displacement to on will do it for ALL materials, not just the materials that had displacement set previous.

Set displacement from On to Off
Code:
import c4d
from c4d import gui

# Main function
def main():
    allMat = doc.GetMaterials()
    for mat in allMat:
        if (mat[c4d.MATERIAL_USE_DISPLACEMENT]):        # displacement On?
            mat[c4d.MATERIAL_USE_DISPLACEMENT] = False  # set to Off

    c4d.EventAdd()

# Execute main()
if __name__=='__main__':
    main()
Set displacement from Off to On
Code:
import c4d
from c4d import gui

# Main function
def main():
    allMat = doc.GetMaterials()
    for mat in allMat:
        if not (mat[c4d.MATERIAL_USE_DISPLACEMENT]):    # displacement Off?
            mat[c4d.MATERIAL_USE_DISPLACEMENT] = True   # set to On

    c4d.EventAdd()

# Execute main()
if __name__=='__main__':
    main()
__________________
Kijk ook eens op mijn YouTube Channel of mijn Cinema4d Blog.
Reply With Quote
  #8  
Old 3 Weeks Ago
Cinemike's Avatar
Cinemike Cinemike is offline
Senior Member
 
Join Date: Jan 2012
Location: Deepest Saxony, Germany
Posts: 670
Default

Nice ones, thx!
__________________
Cinema4D R20 & VrayforC4D 3.7
Reply With Quote
Reply

Tags
displacement, preview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +2. The time now is 22:13.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Met trots gehost door Webdesign bureau Graphic Violence.
(c) C4DLounge.eu . All documents on this forum are owned by their respective creators and may not be sold or republished in any way.