Skip to content

Commit

Permalink
Various Fixes - Mostly Cycles Converter
Browse files Browse the repository at this point in the history
Add missing descriptions for props
Some additional notes in the converters User Guides
Added a workaround for custom screen layouts
The old code accessed the UV editing screen  without checking it's
existence in screen layouts
The workaround temporarly sets the context  to IMAGE EDITOR

Added a texture paint sculpt mode
Adding a blank image for texture paint slot
( still needs proper naming for multiple materials )

Fixed the texture node frame logic
Fixed the loading of texture nodes from images that are not baked

Fix the texture coordinates location
Add frame for them
Add exceptions for creation of links

Added an another prop setting for using uv unwrap
Fixed an issue with possible crash during unwrapping
  • Loading branch information
lijenstina committed Aug 14, 2016
1 parent c8233ef commit 78b3fba
Show file tree
Hide file tree
Showing 2 changed files with 472 additions and 234 deletions.
30 changes: 29 additions & 1 deletion materials_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,10 @@ def draw(self, context):
use_separator(self, context)
layout.prop(sc.mat_specials, "SET_FAKE_USER", text="Set Fake User on unused images")
use_separator(self, context)
layout.prop(sc.mat_specials, "SCULPT_PAINT", text="Sculpt/Texture paint mode")
use_separator(self, context)
layout.prop(sc.mat_specials, "UV_UNWRAP", text="Set Auto UV Unwrap (Active Object)")
use_separator(self, context)

layout.label("Set the Bake Resolution")
res = str(sc.mat_specials.img_bake_size)
Expand Down Expand Up @@ -1798,14 +1802,20 @@ class MATERIAL_MT_biconv_help(Menu):

def draw(self, context):
layout = self.layout
layout.label(text="If possible, avoid multiple conversions in a row")
layout.label(text="Save Your Work Often", icon="ERROR")
use_separator(self, context)
layout.label(text="Try to link them manually using Mix Color nodes")
layout.label(text="Only the last Image in the stack gets linked to Shader")
layout.label(text="Current limitation:", icon="MOD_EXPLODE")
use_separator(self, context)
layout.label(text="Select the texture loaded in the image node")
layout.label(text="Press Ctrl/T to create the image nodes")
layout.label(text="In the Node Editor, Select the Diffuse Node")
layout.label(text="Enable Node Wrangler addon", icon="NODETREE")
layout.label(text="If Unconnected or No Image Node Error:", icon="MOD_EXPLODE")
use_separator(self, context)
layout.label(text="Extract Alpha: the images have to have alpha channel")
layout.label(text="The default path is the folder where the current .blend is")
layout.label(text="During Baking, the script will check writting privileges")
layout.label(text="Set the save path for extracting images with full access")
Expand All @@ -1828,6 +1838,7 @@ class MATERIAL_MT_nodeconv_help(Menu):

def draw(self, context):
layout = self.layout
layout.label(text="If possible, avoid multiple conversions in a row")
layout.label(text="Save Your Work Often", icon="ERROR")
use_separator(self, context)
layout.label(text="Relinking and removing some not needed nodes")
Expand All @@ -1839,6 +1850,7 @@ def draw(self, context):
layout.label(text="Enable Node Wrangler addon", icon="NODETREE")
layout.label(text="If Unconnected or No Image Node Error:", icon="MOD_EXPLODE")
use_separator(self, context)
layout.label(text="For Specular Nodes, Image color influence has to be enabled")
layout.label(text="Generated images (i.e. Noise and others) are not converted")
layout.label(text="The Converter report can point out to some failures")
layout.label(text="Not all Files will produce good results", icon="ERROR")
Expand Down Expand Up @@ -1894,20 +1906,36 @@ class material_specials_scene_props(PropertyGroup):
EXTRACT_ALPHA = BoolProperty(
attr="EXTRACT_ALPHA",
default=False,
description=("Extract Alpha channel from non-procedural images \n"
"Don't use this option if the image doesn't have Alpha"),
)
SET_FAKE_USER = BoolProperty(
attr="SET_FAKE_USER",
default=False,
description="Set fake user on unused images, so they can be kept in the .blend",
)
EXTRACT_PTEX = BoolProperty(
attr="EXTRACT_PTEX",
default=False,
description="Extract procedural images and bake them to jpeg",
)
EXTRACT_OW = BoolProperty(
attr="Overwrite",
default=False,
description="Extract textures again instead of re-using priorly extracted textures",
)
SCULPT_PAINT = BoolProperty(
attr="SCULPT_PAINT",
default=False,
description=("Conversion geared towards sculpting and painting.\n"
"Creates a diffuse, glossy mixed with layer weight. \n"
"Image nodes are not connected"),
)
UV_UNWRAP = BoolProperty(
attr="UV_UNWRAP",
default=False,
description=("Use automatical Angle based UV Unwrap of the active Object"),
)
img_bake_size = EnumProperty(
name="Bake Image Size",
description="Set the resolution size of baked images \n",
Expand Down Expand Up @@ -1970,7 +1998,7 @@ class VIEW3D_MT_material_utils_pref(AddonPreferences):
show_converters = BoolProperty(
name="Enable Converters",
default=True,
description=" \n ",
description="Enable Material Converters",
)

set_preview_size = EnumProperty(
Expand Down
Loading

0 comments on commit 78b3fba

Please sign in to comment.