Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-01-29 05:29:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-29 05:29:08 +0300
commit9dde6b34b254a3882a1366023eca9792033f9b6c (patch)
tree336087914b82b43c8d9be05ba5decf03dbb8be69 /blenderkit/asset_inspector.py
parent5208fe9f300d238d9c87b7cc624e0d483d221907 (diff)
parentb322cc269cafc208294355ea79db714822addf38 (diff)
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'blenderkit/asset_inspector.py')
-rw-r--r--blenderkit/asset_inspector.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/blenderkit/asset_inspector.py b/blenderkit/asset_inspector.py
index 74f814ca..e6fdc659 100644
--- a/blenderkit/asset_inspector.py
+++ b/blenderkit/asset_inspector.py
@@ -85,8 +85,11 @@ def check_render_engine(props, obs):
mattype = None
materials = []
shaders = []
+ textures = []
props.uv = False
-
+ props.texture_count = 0
+ props.total_megapixels = 0
+ props.node_count = 0
for ob in obs: # TODO , this is duplicated here for other engines, otherwise this should be more clever.
for ms in ob.material_slots:
if ms.material is not None:
@@ -108,6 +111,7 @@ def check_render_engine(props, obs):
checknodes = m.node_tree.nodes[:]
while len(checknodes) > 0:
n = checknodes.pop()
+ props.node_count +=1
if n.type == 'GROUP': # dive deeper here.
checknodes.extend(n.node_tree.nodes)
if len(n.outputs) == 1 and n.outputs[0].type == 'SHADER' and n.type != 'GROUP':
@@ -115,19 +119,21 @@ def check_render_engine(props, obs):
shaders.append(n.type)
if n.type == 'TEX_IMAGE':
mattype = 'image based'
- if n.image is not None:
+ props.is_procedural = False
+ if n.image not in textures:
+ textures.append(n.image)
+ props.texture_count += 1
+ props.total_megapixels += (n.image.size[0] * n.image.size[1])
maxres = max(n.image.size[0], n.image.size[1])
-
props.texture_resolution_max = max(props.texture_resolution_max, maxres)
-
minres = min(n.image.size[0], n.image.size[1])
-
if props.texture_resolution_min == 0:
props.texture_resolution_min = minres
else:
props.texture_resolution_min = min(props.texture_resolution_min, minres)
+
# if mattype == None:
# mattype = 'procedural'
# tags['material type'] = mattype