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:
authorVilém Duha <vilda.novak@gmail.com>2020-01-21 18:57:54 +0300
committerVilém Duha <vilda.novak@gmail.com>2020-01-28 15:45:44 +0300
commit7c3d8127daf1f32858076484d07fd8a6e96a3fb0 (patch)
tree5ba32c12caef1c095fd348ae8aef0a9cda7d6c6a /blenderkit/asset_inspector.py
parent11491c5be04d5052632265e0fba7275db2f088e4 (diff)
BlenderKit: add several autotags
megapixels checks number of total pixels in textures. procedural, node count and texture count will help in heuristics and advanced searches.
Diffstat (limited to 'blenderkit/asset_inspector.py')
-rw-r--r--blenderkit/asset_inspector.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/blenderkit/asset_inspector.py b/blenderkit/asset_inspector.py
index 14224b21..e6fdc659 100644
--- a/blenderkit/asset_inspector.py
+++ b/blenderkit/asset_inspector.py
@@ -87,7 +87,9 @@ def check_render_engine(props, obs):
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:
@@ -109,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':