-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcc3.py
46 lines (41 loc) · 1.85 KB
/
cc3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import bpy
from . import utils
NODE_PREFIX = "cc3iid_"
def get_material_cache(mat):
"""Returns the material cache for this material.
Fetches the material cache for the material. Returns None if the material is not in the cache.
"""
props = bpy.context.scene.CC3ImportProps
if mat is not None:
for chr_cache in props.import_cache:
for cache in chr_cache.eye_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.hair_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.head_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.skin_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.tongue_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.teeth_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.tearline_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.eye_occlusion_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.pbr_material_cache:
if cache.material == mat:
return cache
for cache in chr_cache.sss_material_cache:
if cache.material == mat:
return cache
return None