• Daz 3D
  • Shop
  • 3D Software
    • Daz Studio Premier
    • Daz Studio
    • Install Manager
    • Partnerships
    • AI Training data
    • Exporters
    • Daz to Roblox
    • Daz to Maya
    • Daz to Blender
    • Daz to Unreal
    • Daz to Unity
    • Daz to 3ds Max
    • Daz to Cinema 4D
  • 3D Models
    • Genesis 9
    • Genesis 8.1
    • Free 3D Models
  • Community
    • Gallery
    • Forums
    • Blog
    • Press
    • Help
  • Memberships
    • Daz Premier
    • Daz Plus
    • Daz Base
    • Compare
  • Download Studio
ADVANCED SEARCH
  • Menu
  • Daz 3D
ADVANCED SEARCH
Add image
  • Shop
  • 3d Software
    • Daz Studio Premier
    • Daz Studio
    • Install Manager
    • Partnerships
    • AI Training data
    • Exporters
    • Daz to Roblox
    • Daz to Maya
    • Daz to Blender
    • Daz to Unreal
    • Daz to Unity
    • Daz to 3ds Max
    • Daz to Cinema 4D
  • 3D Models
    • Genesis 9
    • Genesis 8.1
    • Free 3D Models
  • Community
    • Our Community
    • Gallery
    • Forums
    • Blog
    • Press
    • Help
  • Memberships
    • Daz Premier
    • Daz Plus
    • Daz Base
    • Compare

Notifications

You currently have no notifications.

Loading...
    • Categories
    • Recent Discussions
Daz 3D Forums > 3rd Party Software > Blender Discussion

Python for Material Library Texture Usage

csaacsaa Posts: 931
July 2021 in Blender Discussion

Hi, to All.

I'm fairly new to Blender and I'm building a library of textures for a set of Daz assets I commonly use. Because I'm into non photo realistic renders (NPR), I create custom cel shaded textures as I go along. Lately I dscovered the Blender add-on called Material Library. I found this add-on very useful for collecting and saving textures as external files. To improve my workflow, the next logical step is to take these textures and apply them automatically by means of Python scripts.

Not knowing much about Python in Blender, my question is: can this be done? Has anyone written scripts to map textures stored in Material Library to the surfaces of a model in Blender? Any tips would be much appreciated.

Thanks!

 

Comments

  • margravemargrave Posts: 1,822
    July 2021

    I've never done it, but I do know you can enable "Python Tooltips" and the API functions will appear when you hover over a command. You can use that to easily figure out how to script what you want to do.

  • TheMysteryIsThePointTheMysteryIsThePoint Posts: 3,220
    July 2021 edited July 2021

    @csaa

    I primarily use Alembic to export to Blender, which doesn't support materials at all, so this was a problem I faced very early on. Take a look at these scripts. I admit that it's rather brittle, i.e. if the order of the slots changes you have to adjust the map file, but I seldom do that.

    Change the file extentions from .txt to .py

    txt
    txt
    sample_map_file.txt
    158B
    txt
    txt
    sample_apply_materials.txt
    3K
    Post edited by TheMysteryIsThePoint on July 2021
  • csaacsaa Posts: 931
    July 2021

    @TheMysteryIsThePoint,

    Thanks for the code! I'll try it out.

    Cheers!

    TheMysteryIsThePoint said:

    @csaa

    I primarily use Alembic to export to Blender, which doesn't support materials at all, so this was a problem I faced very early on. Take a look at these scripts. I admit that it's rather brittle, i.e. if the order of the slots changes you have to adjust the map file, but I seldom do that.

    Change the file extentions from .txt to .py

  • csaacsaa Posts: 931
    July 2021

    @margrave,

    The tooltip exposing the Python API will come in handy. Thanks for the suggestion.

    Cheers!

    margrave said:

    I've never done it, but I do know you can enable "Python Tooltips" and the API functions will appear when you hover over a command. You can use that to easily figure out how to script what you want to do.

Sign In or Register to comment.
Adding to Cart…

Daz 3D is part of Tafi

Connect

DAZ Productions, Inc.
7533 S Center View Ct #4664
West Jordan, UT 84084

HELP

Contact Us

Tutorials

Help Center

Sell Your 3D Content

Affiliate Program

Documentation Center

Open Source

Consent Preferences

JOIN DAZ

Memberships

Blog

About Us

Press

Careers

Bridges

Community

In the Studio

Gallery

Forum

DAZ STORE

Shop

Freebies

Published Artists

Licensing Agreement | Terms of Service | Privacy Policy | EULA

© 2025 Daz Productions Inc. All Rights Reserved.