diff --git a/README.md b/README.md
index 5a3a8f4..6be0289 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ A Material Library for Houdini Mantra, Redshift and Arnold
- Deletion of entries from the database (deletes also from disk)
- Edit multiple materials at the same time via the Details-Pane
- Easy adjustable custom preview and rendersize
-- ACES 1.2 support (Redshift Native)
+- ACES 1.2 support (Redshift Native, Mantra & Arnold need $OCIO)
- Right Click Menus for adding materials quickly from the network pane
- Importing to current network location (pwd()/matnet)
- Double Click or right click for importing Materials into the scene
@@ -59,9 +59,11 @@ A Material Library for Houdini Mantra, Redshift and Arnold
- Do not (!) edit the .json file by hand if not needed
- you have been warned ;)
+### Acknowledgements
+- Thanks to Rich Nosworthy for providing the ShaderBall-Setup - https://www.richnosworthy.tv
### Contact & License
- Found a bug? please open an issue or contact me directly via Twitter
- Twitter: @eglaubauf
-- Feel free to support me via gumroad https://elmeier.gumroad.com/l/bsghA
+- Website: https://elmar-glaubauf.at/
diff --git a/img/FloorTexture.tx b/img/FloorTexture.tx
new file mode 100755
index 0000000..ea7007e
Binary files /dev/null and b/img/FloorTexture.tx differ
diff --git a/img/MatLib.png b/img/MatLib.png
index 58f48f8..5fd01d8 100644
Binary files a/img/MatLib.png and b/img/MatLib.png differ
diff --git a/img/Prefs.png b/img/Prefs.png
deleted file mode 100644
index 02b5828..0000000
Binary files a/img/Prefs.png and /dev/null differ
diff --git a/img/RC1.png b/img/RC1.png
deleted file mode 100644
index fdd5fe7..0000000
Binary files a/img/RC1.png and /dev/null differ
diff --git a/img/RC2.png b/img/RC2.png
deleted file mode 100644
index cb82f5b..0000000
Binary files a/img/RC2.png and /dev/null differ
diff --git a/img/photo_studio_01_4k_ACEScg.tx b/img/photo_studio_01_4k_ACEScg.tx
new file mode 100644
index 0000000..041e7d5
Binary files /dev/null and b/img/photo_studio_01_4k_ACEScg.tx differ
diff --git a/otls/thumbnail_Arnold.2.0.hdalc b/otls/thumbnail_Arnold.3.0.hdalc
similarity index 99%
rename from otls/thumbnail_Arnold.2.0.hdalc
rename to otls/thumbnail_Arnold.3.0.hdalc
index 312a90f..65c9539 100644
Binary files a/otls/thumbnail_Arnold.2.0.hdalc and b/otls/thumbnail_Arnold.3.0.hdalc differ
diff --git a/otls/thumbnail_Mantra.1.0.hda b/otls/thumbnail_Mantra.2.0.hdalc
similarity index 99%
rename from otls/thumbnail_Mantra.1.0.hda
rename to otls/thumbnail_Mantra.2.0.hdalc
index 2f3cb71..397a4e9 100644
Binary files a/otls/thumbnail_Mantra.1.0.hda and b/otls/thumbnail_Mantra.2.0.hdalc differ
diff --git a/otls/thumbnail_Redshift.1.0.hda b/otls/thumbnail_Redshift.2.0.hdalc
similarity index 99%
rename from otls/thumbnail_Redshift.1.0.hda
rename to otls/thumbnail_Redshift.2.0.hdalc
index 343502a..8cf2de1 100644
Binary files a/otls/thumbnail_Redshift.1.0.hda and b/otls/thumbnail_Redshift.2.0.hdalc differ
diff --git a/python2.7libs/About.ui b/python2.7libs/About.ui
new file mode 100644
index 0000000..6e94fbe
--- /dev/null
+++ b/python2.7libs/About.ui
@@ -0,0 +1,154 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 983
+ 836
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 500
+ 400
+
+
+
+ MainWindow
+
+
+
+
+ 0
+ 0
+
+
+
+ -
+
+
-
+
+
-
+
+
+ QFrame::StyledPanel
+
+
+ true
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Lato'; font-size:16pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Acknowledgements:<br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The code and assets are released under GPLv3 as Open Source and are free of charge and free to use modify and embed as stated in GPLv3. Selling or Reselling of the code is not permitted. </p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The tools can be acessed here:<br /><a href="https://github.com/eglaubauf/egMatLib"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/eglaubauf/egMatLib</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; text-decoration: underline; color:#0000ff;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Special Thanks to Rich Nosworthy for providing the ShaderBallScene. </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://www.richnosworthy.tv"><span style=" text-decoration: underline; color:#0000ff;">https://www.richnosworthy.tv</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If you find a bug or have suggestions feel free to contact me here:</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Twitter: <a href="https://twitter.com/eglaubauf"><span style=" text-decoration: underline; color:#0000ff;">@eglaubauf</span></a></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mail: <a href="mailto:e.glaubauf@gmail.com"><span style=" text-decoration: underline; color:#0000ff;">e.glaubauf@gmail.com</span></a></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Github: <a href="https://github.com/eglaubauf"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/eglaubauf</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">2021 - Elmar Glaubauf</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://elmar-glaubauf.at/"><span style=" text-decoration: underline; color:#0000ff;">https://elmar-glaubauf.at/</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+ $HIP
+
+
+
+
+ $HOME
+
+
+
+
+ Recursively Create Thumbs for this Folder (slow)
+
+
+
+
+ Recreate Thumbs for this Folder
+
+
+
+
+ Clear All Materials
+
+
+
+
+ 50
+
+
+
+
+ Add Current Folder to Favourites
+
+
+
+
+ Set Current Library as Default
+
+
+
+
+ Remove Current Folder from Favourites
+
+
+
+
+ Update All Materials
+
+
+
+
+ Set Current Library as Default
+
+
+
+
+ Open Library
+
+
+
+
+ Preferences
+
+
+
+
+
+
diff --git a/python2.7libs/MatLib.ui b/python2.7libs/MatLib.ui
index ffbefce..8c85fcc 100644
--- a/python2.7libs/MatLib.ui
+++ b/python2.7libs/MatLib.ui
@@ -6,7 +6,7 @@
0
0
- 1401
+ 1890
1153
@@ -585,7 +585,7 @@
0
0
- 1401
+ 1890
20
@@ -609,6 +609,8 @@
+
+
@@ -628,6 +630,11 @@
_deleteMaterial
+
+
+ About
+
+
diff --git a/python2.7libs/egMatLib.py b/python2.7libs/egMatLib.py
index 747d4f7..9d5b037 100644
--- a/python2.7libs/egMatLib.py
+++ b/python2.7libs/egMatLib.py
@@ -16,9 +16,9 @@
from PySide2 import QtUiTools
#Load This HDAs for creation
-HDA_REDSHIFT = "thumbnail_Redshift::1.0"
-HDA_MANTRA = "thumbnail_Mantra::1.0"
-HDA_ARNOLD = "thumbnail_Arnold::2.0"
+HDA_REDSHIFT = "thumbnail_Redshift::2.0"
+HDA_MANTRA = "thumbnail_Mantra::2.0"
+HDA_ARNOLD = "thumbnail_Arnold::3.0"
def saveMaterial(node):
@@ -155,6 +155,9 @@ def createView(self):
self.action_prefs = self.ui.findChild(QAction, 'action_prefs')
self.action_prefs.triggered.connect(self.show_prefs)
+ self.action_about = self.ui.findChild(QAction, "action_about")
+ self.action_about.triggered.connect(self.show_about)
+
# Link Buttons
self.btn_save = self.ui.findChild(QPushButton, 'btn_save')
self.btn_save.clicked.connect(self.save_material)
@@ -314,6 +317,13 @@ def catlist_rc_menu(self):
########### USER STUFF ############
###################################
+ def show_about(self):
+
+ about = AboutDialog()
+ about.exec_()
+
+ return
+
def show_prefs(self):
prefs = PrefsDialog(self.library, self.prefs)
@@ -670,16 +680,18 @@ def update_all_materials(self):
def update_single_material(self):
'''Rerenders a single materials in the library - The UI is blocked for the duration of the render'''
items = self.get_selected_items_from_thumblist()
+ call = False
for item in items:
if not item:
return
builder = self.import_material(item)
id = self.get_id_from_thumblist(item)
- self.library.save_node(builder, id)
+ call = self.library.save_node(builder, id)
builder.destroy()
self.update_thumb_view()
- hou.ui.displayMessage("Thumbnail(s) updated")
+ if call:
+ hou.ui.displayMessage("Thumbnail(s) updated")
return
@@ -763,6 +775,7 @@ def get_material_info_user(self, sel):
for mat in sel:
self.library.add_material(mat ,dialog.categories, dialog.tags, dialog.fav)
self.update_views()
+
return
@@ -1093,9 +1106,15 @@ def save_node(self, node, id):
val= self.save_node_redshift(node, id)
elif node.type().name() == "materialbuilder" or node.type().name() == "principledshader::2.0":
#Interruptable
+ if hou.getenv("OCIO") is None:
+ hou.ui.displayMessage("Please set $OCIO first")
+ return False
with hou.InterruptableOperation("Rendering", "Performing Tasks", open_interrupt_dialog=True) as operation:
val = self.save_node_mantra(node, id)
elif node.type().name() == "arnold_materialbuilder":
+ if hou.getenv("OCIO") is None:
+ hou.ui.displayMessage("Please set $OCIO first")
+ return False
with hou.InterruptableOperation("Rendering", "Performing Tasks", open_interrupt_dialog=True) as operation:
val = self.save_node_arnold(node, id)
else:
@@ -1146,10 +1165,12 @@ def save_node_arnold(self, node, id): #ARNOLD
thumb.parm("mat").set(node.path())
# Build path
- path = self.get_path() + self.settings.get_img_dir() + str(id) + self.settings.get_img_ext()
+ path = self.get_path() + self.settings.get_img_dir() + str(id)
# Set Rendersettings and Object Exclusions for Thumbnail Rendering
- thumb.parm("path").set(path)
+ thumb.parm("path").set(path+".exr")
+ thumb.parm("cop_out_img").set(path+self.settings.get_img_ext())
+
exclude = "* ^" + thumb.name()
thumb.parm("obj_exclude").set(exclude)
lights = thumb.name() + "/*"
@@ -1174,6 +1195,9 @@ def save_node_arnold(self, node, id): #ARNOLD
thumb.destroy()
+ if os.path.exists(path+".exr"):
+ os.remove(path+".exr")
+
return True
def save_node_mantra(self, node, id):
@@ -1202,10 +1226,11 @@ def save_node_mantra(self, node, id):
thumb.parm("mat").set(node.path())
# Build path
- path = self.get_path() + self.settings.get_img_dir() + str(id) + self.settings.get_img_ext()
+ path = self.get_path() + self.settings.get_img_dir() + str(id)
# Set Rendersettings and Object Exclusions for Thumbnail Rendering
- thumb.parm("path").set(path)
+ thumb.parm("path").set(path+".exr")
+ thumb.parm("cop_out_img").set(path+self.settings.get_img_ext())
exclude = "* ^" + thumb.name()
thumb.parm("obj_exclude").set(exclude)
lights = thumb.name() + "/*"
@@ -1216,8 +1241,12 @@ def save_node_mantra(self, node, id):
# Render Frame
thumb.parm("render").pressButton()
+
# CleanUp
thumb.destroy()
+ if os.path.exists(path+".exr"):
+ os.remove(path+".exr")
+
return True
@@ -1400,3 +1429,24 @@ def fill_values(self):
self.line_workdir.setText(self.directory)
self.line_rendersize.setText(str(self.rendersize))
self.line_thumbsize.setText(str(self.thumbsize))
+
+
+class AboutDialog(QDialog):
+ def __init__(self):
+ super(AboutDialog, self).__init__()
+ self.script_path = os.path.dirname(os.path.realpath(__file__))
+
+ ## LOAD UI
+ ## Load UI from ui.file
+ loader = QtUiTools.QUiLoader()
+ file = QFile(self.script_path + '/About.ui')
+ file.open(QFile.ReadOnly)
+ self.ui = loader.load(file)
+ file.close()
+
+ # set main layout and attach to widget
+ mainLayout = QVBoxLayout()
+ mainLayout.addWidget(self.ui)
+ mainLayout.setContentsMargins(0, 0, 0, 0) # Remove Margins
+
+ self.setLayout(mainLayout)
diff --git a/python3.7libs/About.ui b/python3.7libs/About.ui
new file mode 100644
index 0000000..6e94fbe
--- /dev/null
+++ b/python3.7libs/About.ui
@@ -0,0 +1,154 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 983
+ 836
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 500
+ 400
+
+
+
+ MainWindow
+
+
+
+
+ 0
+ 0
+
+
+
+ -
+
+
-
+
+
-
+
+
+ QFrame::StyledPanel
+
+
+ true
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Lato'; font-size:16pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Acknowledgements:<br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The code and assets are released under GPLv3 as Open Source and are free of charge and free to use modify and embed as stated in GPLv3. Selling or Reselling of the code is not permitted. </p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The tools can be acessed here:<br /><a href="https://github.com/eglaubauf/egMatLib"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/eglaubauf/egMatLib</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; text-decoration: underline; color:#0000ff;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Special Thanks to Rich Nosworthy for providing the ShaderBallScene. </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://www.richnosworthy.tv"><span style=" text-decoration: underline; color:#0000ff;">https://www.richnosworthy.tv</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If you find a bug or have suggestions feel free to contact me here:</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Twitter: <a href="https://twitter.com/eglaubauf"><span style=" text-decoration: underline; color:#0000ff;">@eglaubauf</span></a></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mail: <a href="mailto:e.glaubauf@gmail.com"><span style=" text-decoration: underline; color:#0000ff;">e.glaubauf@gmail.com</span></a></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Github: <a href="https://github.com/eglaubauf"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/eglaubauf</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">2021 - Elmar Glaubauf</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://elmar-glaubauf.at/"><span style=" text-decoration: underline; color:#0000ff;">https://elmar-glaubauf.at/</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+ $HIP
+
+
+
+
+ $HOME
+
+
+
+
+ Recursively Create Thumbs for this Folder (slow)
+
+
+
+
+ Recreate Thumbs for this Folder
+
+
+
+
+ Clear All Materials
+
+
+
+
+ 50
+
+
+
+
+ Add Current Folder to Favourites
+
+
+
+
+ Set Current Library as Default
+
+
+
+
+ Remove Current Folder from Favourites
+
+
+
+
+ Update All Materials
+
+
+
+
+ Set Current Library as Default
+
+
+
+
+ Open Library
+
+
+
+
+ Preferences
+
+
+
+
+
+
diff --git a/python3.7libs/MatLib.ui b/python3.7libs/MatLib.ui
index ffbefce..8c85fcc 100644
--- a/python3.7libs/MatLib.ui
+++ b/python3.7libs/MatLib.ui
@@ -6,7 +6,7 @@
0
0
- 1401
+ 1890
1153
@@ -585,7 +585,7 @@
0
0
- 1401
+ 1890
20
@@ -609,6 +609,8 @@
+
+
@@ -628,6 +630,11 @@
_deleteMaterial
+
+
+ About
+
+
diff --git a/python3.7libs/egMatLib.py b/python3.7libs/egMatLib.py
index eb2dc94..221163f 100644
--- a/python3.7libs/egMatLib.py
+++ b/python3.7libs/egMatLib.py
@@ -16,9 +16,9 @@
#Load This HDAs for creation
-HDA_REDSHIFT = "thumbnail_Redshift::1.0"
-HDA_MANTRA = "thumbnail_Mantra::1.0"
-HDA_ARNOLD = "thumbnail_Arnold::2.0"
+HDA_REDSHIFT = "thumbnail_Redshift::2.0"
+HDA_MANTRA = "thumbnail_Mantra::2.0"
+HDA_ARNOLD = "thumbnail_Arnold::3.0"
def saveMaterial(node):
@@ -155,6 +155,9 @@ def createView(self):
self.action_prefs = self.ui.findChild(QAction, 'action_prefs')
self.action_prefs.triggered.connect(self.show_prefs)
+ self.action_about = self.ui.findChild(QAction, "action_about")
+ self.action_about.triggered.connect(self.show_about)
+
# Link Buttons
self.btn_save = self.ui.findChild(QPushButton, 'btn_save')
self.btn_save.clicked.connect(self.save_material)
@@ -314,6 +317,13 @@ def catlist_rc_menu(self):
########### USER STUFF ############
###################################
+ def show_about(self):
+
+ about = AboutDialog()
+ about.exec_()
+
+ return
+
def show_prefs(self):
prefs = PrefsDialog(self.library, self.prefs)
@@ -670,16 +680,18 @@ def update_all_materials(self):
def update_single_material(self):
'''Rerenders a single materials in the library - The UI is blocked for the duration of the render'''
items = self.get_selected_items_from_thumblist()
+ call = False
for item in items:
if not item:
return
builder = self.import_material(item)
id = self.get_id_from_thumblist(item)
- self.library.save_node(builder, id)
+ call = self.library.save_node(builder, id)
builder.destroy()
self.update_thumb_view()
- hou.ui.displayMessage("Thumbnail(s) updated")
+ if call:
+ hou.ui.displayMessage("Thumbnail(s) updated")
return
@@ -1094,9 +1106,15 @@ def save_node(self, node, id):
val= self.save_node_redshift(node, id)
elif node.type().name() == "materialbuilder" or node.type().name() == "principledshader::2.0":
#Interruptable
+ if hou.getenv("OCIO") is None:
+ hou.ui.displayMessage("Please set $OCIO first")
+ return False
with hou.InterruptableOperation("Rendering", "Performing Tasks", open_interrupt_dialog=True) as operation:
val = self.save_node_mantra(node, id)
elif node.type().name() == "arnold_materialbuilder":
+ if hou.getenv("OCIO") is None:
+ hou.ui.displayMessage("Please set $OCIO first")
+ return False
with hou.InterruptableOperation("Rendering", "Performing Tasks", open_interrupt_dialog=True) as operation:
val = self.save_node_arnold(node, id)
else:
@@ -1147,10 +1165,12 @@ def save_node_arnold(self, node, id): #ARNOLD
thumb.parm("mat").set(node.path())
# Build path
- path = self.get_path() + self.settings.get_img_dir() + str(id) + self.settings.get_img_ext()
+ path = self.get_path() + self.settings.get_img_dir() + str(id)
# Set Rendersettings and Object Exclusions for Thumbnail Rendering
- thumb.parm("path").set(path)
+ thumb.parm("path").set(path+".exr")
+ thumb.parm("cop_out_img").set(path+self.settings.get_img_ext())
+
exclude = "* ^" + thumb.name()
thumb.parm("obj_exclude").set(exclude)
lights = thumb.name() + "/*"
@@ -1175,6 +1195,9 @@ def save_node_arnold(self, node, id): #ARNOLD
thumb.destroy()
+ if os.path.exists(path+".exr"):
+ os.remove(path+".exr")
+
return True
def save_node_mantra(self, node, id):
@@ -1203,10 +1226,11 @@ def save_node_mantra(self, node, id):
thumb.parm("mat").set(node.path())
# Build path
- path = self.get_path() + self.settings.get_img_dir() + str(id) + self.settings.get_img_ext()
+ path = self.get_path() + self.settings.get_img_dir() + str(id)
# Set Rendersettings and Object Exclusions for Thumbnail Rendering
- thumb.parm("path").set(path)
+ thumb.parm("path").set(path+".exr")
+ thumb.parm("cop_out_img").set(path+self.settings.get_img_ext())
exclude = "* ^" + thumb.name()
thumb.parm("obj_exclude").set(exclude)
lights = thumb.name() + "/*"
@@ -1217,8 +1241,12 @@ def save_node_mantra(self, node, id):
# Render Frame
thumb.parm("render").pressButton()
+
# CleanUp
thumb.destroy()
+ if os.path.exists(path+".exr"):
+ os.remove(path+".exr")
+
return True
@@ -1401,3 +1429,24 @@ def fill_values(self):
self.line_workdir.setText(self.directory)
self.line_rendersize.setText(str(self.rendersize))
self.line_thumbsize.setText(str(self.thumbsize))
+
+
+class AboutDialog(QDialog):
+ def __init__(self):
+ super(AboutDialog, self).__init__()
+ self.script_path = os.path.dirname(os.path.realpath(__file__))
+
+ ## LOAD UI
+ ## Load UI from ui.file
+ loader = QtUiTools.QUiLoader()
+ file = QFile(self.script_path + '/About.ui')
+ file.open(QFile.ReadOnly)
+ self.ui = loader.load(file)
+ file.close()
+
+ # set main layout and attach to widget
+ mainLayout = QVBoxLayout()
+ mainLayout.addWidget(self.ui)
+ mainLayout.setContentsMargins(0, 0, 0, 0) # Remove Margins
+
+ self.setLayout(mainLayout)