Sat, Jan 4, 5:38 PM CST

Renderosity Forums / Poser 12



Welcome to the Poser 12 Forum

Forum Moderators: nerd Forum Coordinators: nerd

Poser 12 F.A.Q (Last Updated: 2024 Dec 22 9:02 pm)



Welcome to the Poser Forums! Need help with these versions, advice on upgrading? Etc...you've arrived at the right place!


Looking for Poser Tutorials? Find those HERE



Subject: Two Python scripts to speed up things in the Material Room


Y-Phil ( ) posted Wed, 25 August 2021 at 2:44 PM ยท edited Mon, 23 December 2024 at 8:43 PM

The first script turns off all previews of all layers of all materials of all actors:

for actor in poser.Scene().Actors():
    mats = actor.Materials()
    if not mats:
        continue
    
    for mat in mats:
        for layer in mat.Layers():
            tree = layer.ShaderTree()
            for node in tree.Nodes():
                node.SetPreviewCollapsed(0)
            tree.UpdatePreview()

It's small, but it has such an effect in the Material room: switching to another material is instantaneous now. And of course, here its friend: a script to turn on the preview of only a subset, and only in the current material:


searched_types = [
    'image_map', 
    'ccl_ImageTexture',
    'poser',
    'CyclesSurface',
    'PhysicalSurface'
]

mat = poser.Scene().CurrentMaterial()
if mat:
    tree = mat.ShaderTree()
    for node in [n for n in tree.Nodes() if n.Type() in searched_types]:
        node.SetPreviewCollapsed(1)
    tree.UpdatePreview()

๐’ซ๐’ฝ๐“Ž๐“


(ใฃโ—”โ—กโ—”)ใฃ

๐Ÿ‘ฟย Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
๐Ÿ‘ฟย Mac Mini M2, Sequoia 15.2, 16GB, 500GB SSD
๐Ÿ‘ฟย Nas 10TB
๐Ÿ‘ฟย Poser 13 and soon 14ย โค๏ธ


hborre ( ) posted Wed, 25 August 2021 at 3:03 PM

This looks very promising. Thank you, I shall implement both into my app.


Y-Phil ( ) posted Wed, 25 August 2021 at 3:18 PM

The first script was crashing with lights. Here is the updated version:

for actor in poser.Scene().Actors():
    mats = actor.Materials()
    if not mats:
        continue
    
    for mat in mats:
        for layer in mat.Layers():
            try:
                tree = layer.ShaderTree()
            except:
                continue
            for node in tree.Nodes():
                node.SetPreviewCollapsed(0)
            tree.UpdatePreview()

๐’ซ๐’ฝ๐“Ž๐“


(ใฃโ—”โ—กโ—”)ใฃ

๐Ÿ‘ฟย Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
๐Ÿ‘ฟย Mac Mini M2, Sequoia 15.2, 16GB, 500GB SSD
๐Ÿ‘ฟย Nas 10TB
๐Ÿ‘ฟย Poser 13 and soon 14ย โค๏ธ


RedPhantom ( ) posted Wed, 25 August 2021 at 4:54 PM ยท edited Wed, 25 August 2021 at 4:54 PM
Site Admin

Thanks so much. These will come in handy. I've had to close them all even with Poser 11 since I first got it.


Available on Amazon for the Kindle E-Reader Monster of the North and The Shimmering Mage

Today I break my own personal record for the number of days for being alive.
Check out my store here or my free stuff here
I use Poser 13 and win 10


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.