-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathproperties.py
3153 lines (2747 loc) · 179 KB
/
properties.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (C) 2021 Victor Soupday
# This file is part of CC/iC Blender Tools <https://github.com/soupday/cc_blender_tools>
#
# CC/iC Blender Tools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# CC/iC Blender Tools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with CC/iC Blender Tools. If not, see <https://www.gnu.org/licenses/>.
import bpy, os, socket
from mathutils import Vector
from . import (channel_mixer, imageutils, meshutils, sculpting, materials,
springbones, rigify_mapping_data, modifiers, nodeutils, shaders,
params, physics, basic, jsonutils, utils, vars)
from .meshutils import get_head_body_object_quick
def open_mouth_update(self, context):
props: CC3ImportProps = vars.props()
chr_cache = props.get_context_character_cache(context)
bone = utils.find_pose_bone(chr_cache, "CC_Base_JawRoot", "JawRoot")
if bone is not None:
constraint = None
for con in bone.constraints:
if "iCC3_open_mouth_contraint" in con.name:
constraint = con
if chr_cache.open_mouth == 0:
if constraint is not None:
constraint.influence = chr_cache.open_mouth
bone.constraints.remove(constraint)
else:
if constraint is None:
constraint = bone.constraints.new(type="LIMIT_ROTATION")
constraint.name = "iCC3_open_mouth_contraint"
constraint.use_limit_z = True
constraint.min_z = 0.43633
constraint.max_z = 0.43633
constraint.owner_space = "LOCAL"
constraint.influence = chr_cache.open_mouth
def eye_close_update(self, context):
props: CC3ImportProps = vars.props()
chr_cache = props.get_context_character_cache(context)
value = chr_cache.eye_close
if chr_cache:
objects = chr_cache.get_cache_objects()
BLINK_SHAPES = ["Eye_Blink", "Eye_Blink_L", "Eye_Blink_R"]
for obj in objects:
obj_cache = chr_cache.get_object_cache(obj)
if obj_cache and not obj_cache.disabled and obj_cache.is_mesh():
if (obj_cache.object_type == "BODY" or
obj_cache.object_type == "EYE_OCCLUSION" or
obj_cache.object_type == "TEARLINE"):
if obj.data.shape_keys and obj.data.shape_keys.key_blocks:
for key in BLINK_SHAPES:
if key in obj.data.shape_keys.key_blocks:
try:
obj.data.shape_keys.key_blocks[key].value = value
except:
pass
def adjust_lighting_brightness(self, context):
props = vars.props()
for light in bpy.data.objects:
if light.type == "LIGHT":
if not props.lighting_brightness_all and not utils.has_ccic_id(light):
continue
current_brightness = light.data.energy
if "rl_default_brightness" not in light.data:
light.data["rl_default_brightness"] = current_brightness
if "rl_last_brightness" not in light.data:
light.data["rl_last_brightness"] = current_brightness
last_brightness = light.data["rl_last_brightness"]
# if the brightness has been changed by the user, update the custom props
if abs(current_brightness-last_brightness) >= 0.001:
light.data["rl_default_brightness"] = current_brightness
light.data["rl_last_brightness"] = current_brightness
base_energy = light.data["rl_default_brightness"]
new_brightness = base_energy * props.lighting_brightness
light.data.energy = new_brightness
light.data["rl_last_brightness"] = new_brightness
def adjust_world_brightness(self, context):
props = vars.props()
nodes = context.scene.world.node_tree.nodes
for node in nodes:
if node.type == "BACKGROUND" and "(rl_background_node)" in node.name:
current_strength = node.inputs["Strength"].default_value
if "rl_default_strength" not in node:
node["rl_default_strength"] = current_strength
if "rl_last_strength" not in node:
node["rl_last_strength"] = current_strength
last_strength = node["rl_last_strength"]
# if the node strength has been changed by the user, update the custom props
if abs(current_strength - last_strength) >= 0.001:
node["rl_default_strength"] = current_strength
node["rl_last_strength"] = current_strength
base_strength = node["rl_default_strength"]
new_strength = base_strength * props.world_brightness
node.inputs["Strength"].default_value = new_strength
node["rl_last_strength"] = new_strength
def update_property(self, context, prop_name, update_mode = None):
props = vars.props()
if vars.block_property_update: return
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
if chr_cache:
context_obj = context.object
context_mat = utils.get_context_material(context)
context_mat_cache = chr_cache.get_material_cache(context_mat)
linked_materials = get_linked_materials(chr_cache, context_mat, props.update_mode)
for mat_cache in linked_materials:
if mat_cache.material == context_mat:
update_shader_property(context_obj, mat_cache, prop_name)
else:
set_linked_property(prop_name, context_mat_cache, mat_cache)
update_shader_property(context_obj, mat_cache, prop_name)
# these properties will cause the eye displacement vertex group to change...
if prop_name in ["eye_iris_depth_radius", "eye_iris_scale", "eye_iris_radius"]:
meshutils.rebuild_eye_vertex_groups(chr_cache)
def update_basic_property(self, context, prop_name, update_mode=None):
if vars.block_property_update: return
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
if chr_cache:
all_materials_cache = chr_cache.get_all_materials_cache()
for mat_cache in all_materials_cache:
mat = mat_cache.material
if mat:
basic.update_basic_material(mat, mat_cache, prop_name)
def update_material_property(self, context, prop_name, update_mode=None):
if vars.block_property_update: return
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
if chr_cache:
context_obj = context.object
context_mat = utils.get_context_material(context)
context_mat_cache = chr_cache.get_material_cache(context_mat)
if context_mat_cache:
try:
value = eval("context_mat_cache." + prop_name, None, locals())
context_mat["rl_" + prop_name] = value
except:
pass
def update_object_property(self, context, prop_name, update_mode=None):
if vars.block_property_update: return
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
if chr_cache:
context_obj = context.object
context_obj_cache = chr_cache.get_object_cache(context_obj)
if context_obj_cache:
try:
value = eval("context_obj_cache." + prop_name, None, locals())
context_obj["rl_" + prop_name] = value
except:
pass
def get_linked_material_types(mat_cache):
if mat_cache:
for linked in params.LINKED_MATERIALS:
if mat_cache.material_type in linked:
return linked
return []
def get_paired_material_types(mat_cache):
if mat_cache:
for paired in params.PAIRED_MATERIALS:
if mat_cache.material_type in paired:
return paired
return []
def get_linked_material_names(mat_name):
for linked in params.LINKED_MATERIAL_NAMES:
if mat_name in linked:
return linked
return []
def set_linked_property(prop_name, active_mat_cache, mat_cache):
vars.block_property_update = True
code = ""
try:
parameters = mat_cache.parameters
active_parameters = active_mat_cache.parameters
code = "parameters." + prop_name + " = active_parameters." + prop_name
exec(code, None, locals())
except Exception as e:
utils.log_error("set_linked_property(): Unable to evaluate: " + code, e)
vars.block_property_update = False
def update_shader_property(obj, mat_cache, prop_name):
props = vars.props()
if not mat_cache: return
mat = mat_cache.material
if mat and mat.node_tree:
shader_name = params.get_shader_name(mat_cache)
bsdf_node, shader_node, mix_node = nodeutils.get_shader_nodes(mat, shader_name)
shader_def = params.get_shader_def(shader_name)
if shader_def:
if "inputs" in shader_def.keys():
update_shader_input(shader_node, mat_cache, prop_name, shader_def["inputs"])
if "bsdf" in shader_def.keys():
bsdf_nodes = nodeutils.get_custom_bsdf_nodes(bsdf_node)
for bsdf_node in bsdf_nodes:
update_bsdf_input(bsdf_node, mat_cache, prop_name, shader_def["bsdf"])
if "textures" in shader_def.keys():
update_shader_tiling(shader_name, mat, mat_cache, prop_name, shader_def["textures"])
if "mapping" in shader_def.keys():
update_shader_mapping(shader_name, mat, mat_cache, prop_name, shader_def["mapping"])
if "modifiers" in shader_def.keys():
update_object_modifier(obj, mat_cache, prop_name, shader_def["modifiers"])
if "settings" in shader_def.keys():
update_material_setting(mat, mat_cache, prop_name, shader_def["settings"])
else:
utils.log_error("No shader definition for: " + shader_name)
def update_shader_input(shader_node, mat_cache, prop_name, input_defs):
if shader_node:
for input_def in input_defs:
if prop_name in input_def[2:]:
nodeutils.set_node_input_value(shader_node, input_def[0], shaders.eval_input_param(input_def, mat_cache))
def update_bsdf_input(bsdf_node, mat_cache, prop_name, bsdf_defs):
if bsdf_node:
for input_def in bsdf_defs:
if prop_name in input_def[2:]:
nodeutils.set_node_input_value(bsdf_node,
input_def[0],
shaders.eval_input_param(input_def, mat_cache))
def update_shader_tiling(shader_name, mat, mat_cache, prop_name, texture_defs):
for texture_def in texture_defs:
if len(texture_def) > 5:
tiling_props = texture_def[5:]
texture_type = texture_def[2]
if prop_name in tiling_props:
tiling_node = nodeutils.get_tiling_node(mat, shader_name, texture_type)
nodeutils.set_node_input_value(tiling_node, "Tiling", shaders.eval_tiling_param(texture_def, mat_cache))
def update_shader_mapping(shader_name, mat, mat_cache, prop_name, mapping_defs):
mapping_node = None
for mapping_def in mapping_defs:
if len(mapping_def) == 1:
texture_type = mapping_def[0]
mapping_node = nodeutils.get_tiling_node(mat, shader_name, texture_type)
elif mapping_node:
tiling_props = mapping_def[3:]
if prop_name in tiling_props:
socket_name = mapping_def[1]
nodeutils.set_node_input_value(mapping_node, socket_name, shaders.eval_tiling_param(mapping_def, mat_cache, 2))
def update_object_modifier(obj, mat_cache, prop_name, mod_defs):
for mod_def in mod_defs:
if mod_def[0] == prop_name:
material_type = mod_def[1]
mod_type = mod_def[2]
mod_name = mod_def[3]
code = mod_def[4]
if mat_cache.material_type == material_type:
mod = modifiers.get_object_modifier(obj, mod_type, mod_name)
if mod:
try:
parameters = mat_cache.parameters
exec(code, None, locals())
except:
utils.log_error("update_object_modifier(): unable to execute: " + code)
def update_material_setting(mat, mat_cache, prop_name, setting_defs):
# mat is used in the exec code expression so keep it!
for setting_def in setting_defs:
if setting_def[0] == prop_name:
material_type = setting_def[1]
code = setting_def[2]
if mat_cache.material_type == material_type:
try:
parameters = mat_cache.parameters
exec(code, None, locals())
except:
utils.log_error("update_material_setting(): unable to execute: " + code)
def update_wrinkle_strength_all(self, context):
if vars.block_property_update: return
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
obj = get_head_body_object_quick(chr_cache)
if obj:
value = props.wrinkle_strength
prop_name = "wrinkle_regions"
for i in range(0,13):
if prop_name in obj:
obj[prop_name][i] = value
return
def update_wrinkle_curve_all(self, context):
if vars.block_property_update: return
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
obj = get_head_body_object_quick(chr_cache)
if obj:
value = props.wrinkle_curve
prop_name = "wrinkle_curves"
for i in range(0,13):
if prop_name in obj:
obj[prop_name][i] = value
return
def get_linked_materials(chr_cache, context_mat, update_mode):
props = vars.props()
linked_mats = set()
if chr_cache:
context_mat_cache = chr_cache.get_material_cache(context_mat)
if context_mat and context_mat_cache:
linked_mats.add(context_mat_cache)
all_materials_cache = chr_cache.get_all_materials_cache()
# linked materials are the same material type which need to be updated
# at the same time with the same values (but only when updating as linked)
linked_types = get_linked_material_types(context_mat_cache)
# paired materials are linked materials that must *always* be updated at the same time
# regardless of updating linked or not. e.g. Eye_L, Cornea_L
paired_types = get_paired_material_types(context_mat_cache)
# linked names are linked materials of common default types (pbr/sss) that are usually linked.
linked_names = get_linked_material_names(context_mat_cache.get_base_name())
all_materials_cache = chr_cache.get_all_materials_cache()
for mat_cache in all_materials_cache:
mat = mat_cache.material
if mat:
if mat_cache.material_type in paired_types:
linked_mats.add(mat_cache)
elif update_mode == "UPDATE_LINKED":
if mat_cache.material_type in linked_types or mat_cache.get_base_name() in linked_names:
linked_mats.add(mat_cache)
return [mc for mc in linked_mats]
def reset_parameters(context = bpy.context, all=False):
props = vars.props()
chr_cache = props.get_context_character_cache(context)
chr_json = chr_cache.get_character_json()
if chr_cache:
vars.block_property_update = True
if all:
shaders.init_character_property_defaults(chr_cache, chr_json)
else:
context_mat = utils.get_context_material(context)
linked_mats = get_linked_materials(chr_cache, context_mat, props.update_mode)
if linked_mats:
mats = [mat_cache.material for mat_cache in linked_mats]
shaders.init_character_property_defaults(chr_cache, chr_json, only=mats)
basic.init_basic_default(chr_cache)
vars.block_property_update = False
update_all_properties(context)
def update_all_properties(context, update_mode = None):
if vars.block_property_update: return
utils.start_timer()
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
if chr_cache:
processed = []
for obj in chr_cache.get_cache_objects():
obj_cache = chr_cache.get_object_cache(obj)
if obj_cache and not obj_cache.disabled and obj_cache.is_mesh() and obj not in processed:
processed.append(obj)
for mat in obj.data.materials:
already_processed = mat in processed
mat_cache = chr_cache.get_material_cache(mat)
if chr_cache.setup_mode == "BASIC":
if not already_processed:
basic.update_basic_material(mat, mat_cache, "ALL")
else: # ADVANCED
shader_name = params.get_shader_name(mat_cache)
bsdf_node, shader_node, mix_node = nodeutils.get_shader_nodes(mat, shader_name)
shader_def = params.get_shader_def(shader_name)
if not already_processed:
shaders.apply_prop_matrix(bsdf_node, shader_node, mat_cache, shader_name)
if "textures" in shader_def.keys():
for tex_def in shader_def["textures"]:
tiling_props = tex_def[5:]
for prop_name in tiling_props:
update_shader_property(obj, mat_cache, prop_name)
# modifiers need updating even if material already processed for split objects
if "modifiers" in shader_def.keys():
for mod_def in shader_def["modifiers"]:
prop_name = mod_def[0]
update_shader_property(obj, mat_cache, prop_name)
if not already_processed:
if "settings" in shader_def.keys():
for mat_def in shader_def["settings"]:
prop_name = mat_def[0]
update_shader_property(obj, mat_cache, prop_name)
processed.append(mat)
if obj_cache.is_eye():
meshutils.rebuild_eye_vertex_groups(chr_cache)
utils.log_timer("update_all_properties()", "ms")
def init_material_property_defaults(obj, mat, obj_cache, mat_cache, obj_json, mat_json):
if obj and obj_cache and mat and mat_cache:
utils.log_info("Re-Initializing Material Property Defaults: " + mat.name + " (" + mat_cache.material_type + ")")
if mat_cache.is_eye():
cornea_mat, cornea_mat_cache = materials.get_cornea_mat(obj, mat, mat_cache)
mat_json = jsonutils.get_material_json(obj_json, cornea_mat)
shaders.fetch_prop_defaults(obj, mat_cache, mat_json)
def update_sculpt_mix_node(self, context, prop_name):
if vars.block_property_update: return
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
if chr_cache:
if prop_name == "detail_normal_strength":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_DETAIL, "Normal Strength", chr_cache.detail_normal_strength * 1)
elif prop_name == "body_normal_strength":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_SCULPT, "Normal Strength", chr_cache.body_normal_strength * 1)
elif prop_name == "detail_ao_strength":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_DETAIL, "AO Strength", chr_cache.detail_ao_strength * 1)
elif prop_name == "body_ao_strength":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_SCULPT, "AO Strength", chr_cache.body_ao_strength * 1)
elif prop_name == "detail_normal_definition":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_DETAIL, "Definition", chr_cache.detail_normal_definition * 1)
elif prop_name == "body_normal_definition":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_SCULPT, "Definition", chr_cache.body_normal_definition * 1)
elif prop_name == "detail_mix_mode":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_DETAIL, "Mix Mode", (1.0 if chr_cache.detail_mix_mode == "REPLACE" else 0.0))
elif prop_name == "body_mix_mode":
sculpting.update_layer_nodes(context, chr_cache, sculpting.LAYER_TARGET_SCULPT, "Mix Mode", (1.0 if chr_cache.body_mix_mode == "REPLACE" else 0.0))
def update_rig_target(self, context):
props = vars.props()
chr_cache: CC3CharacterCache = props.get_context_character_cache(context)
if chr_cache:
if self.hair_rig_target == "CC4":
self.hair_rig_bone_length = 7.5
self.hair_rig_bind_skip_length = 0.0
self.hair_rig_bind_trunc_length = 0.5
self.hair_rig_bind_bone_radius = 11.25
self.hair_rig_bind_existing_scale = 0.0
self.hair_rig_bind_bone_count = 2
self.hair_rig_bind_bone_weight = 1.0
self.hair_rig_bind_smoothing = 5
self.hair_rig_bind_weight_curve = 0.5
self.hair_rig_bind_bone_variance = 0.75
elif self.hair_rig_target == "UNITY":
self.hair_rig_bone_length = 7.5
self.hair_rig_bind_skip_length = 7.5
self.hair_rig_bind_trunc_length = 0.5
self.hair_rig_bind_bone_radius = 11.25
self.hair_rig_bind_existing_scale = 0.1
self.hair_rig_bind_bone_count = 2
self.hair_rig_bind_bone_weight = 1.0
self.hair_rig_bind_smoothing = 5
self.hair_rig_bind_weight_curve = 0.5
self.hair_rig_bind_bone_variance = 0.75
elif self.hair_rig_target == "BLENDER":
self.hair_rig_bone_length = 7.5
self.hair_rig_bind_skip_length = 7.5/2.0
self.hair_rig_bind_trunc_length = 2.5
self.hair_rig_bind_bone_radius = 11.25
self.hair_rig_bind_existing_scale = 0.1
self.hair_rig_bind_bone_count = 2
self.hair_rig_bind_bone_weight = 1.0
self.hair_rig_bind_smoothing = 5
self.hair_rig_bind_weight_curve = 0.5
self.hair_rig_bind_bone_variance = 0.75
def update_link_target(self, context):
link_props = vars.link_props()
if link_props.link_target == "BLENDER":
link_props.link_port = 9334
elif link_props.link_target == "CCIC":
link_props.link_port = 9333
elif link_props.link_target == "UNITY":
link_props.link_port = 9335
else:
link_props.link_port = 9333
def update_link_host(self, context):
link_props = vars.link_props()
host = link_props.link_host
if host:
try:
link_props.link_host_ip = socket.gethostbyname(host)
except:
link_props.link_host_ip = "127.0.0.1"
def update_link_host_ip(self, context):
link_props = vars.link_props()
host_ip = link_props.link_host_ip
if host_ip:
try:
link_props.link_host = socket.gethostbyaddr(host_ip)
except:
link_props.link_host = ""
def clean_collection_property(collection_prop):
"""Remove any item.disabled items from validatable objects in collection property."""
repeat = True
while repeat:
repeat = False
for item in collection_prop:
valid_func = getattr(item, "validate", None)
if callable(valid_func):
if item.disabled:
repeat = True
utils.remove_from_collection(collection_prop, item)
break
class CC3OperatorProperties(bpy.types.Operator):
"""CC3 Property Functions"""
bl_idname = "cc3.setproperties"
bl_label = "CC3 Property Functions"
bl_options = {"REGISTER", "UNDO", "INTERNAL"}
param: bpy.props.StringProperty(
name = "param",
default = ""
)
def execute(self, context):
if self.param == "RESET":
reset_parameters(context, all=False)
if self.param == "RESET_ALL":
reset_parameters(context, all=True)
if self.param == "APPLY_ALL":
update_all_properties(context)
return {"FINISHED"}
@classmethod
def description(cls, context, properties):
if properties.param == "RESET":
return "Reset parameters to the defaults for this material and any linked materials if in linked mode"
return ""
class CC3ActionList(bpy.types.PropertyGroup):
action: bpy.props.PointerProperty(type=bpy.types.Armature)
action_type: bpy.props.EnumProperty(items=vars.ENUM_ACTION_TYPES, default="NONE")
armature_type: bpy.props.EnumProperty(items=vars.ENUM_ARMATURE_TYPES, default="NONE")
class CC3ArmatureList(bpy.types.PropertyGroup):
armature: bpy.props.PointerProperty(type=bpy.types.Armature)
armature_type: bpy.props.EnumProperty(items=vars.ENUM_ARMATURE_TYPES, default="NONE")
actions: bpy.props.CollectionProperty(type=CC3ActionList)
class CC3HeadParameters(bpy.types.PropertyGroup):
# shader (rl_head_shader)
skin_diffuse_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1, 1, 1, 1), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"skin_diffuse_color"))
skin_diffuse_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_diffuse_hue"))
skin_diffuse_brightness: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_diffuse_brightness"))
skin_diffuse_saturation: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_diffuse_saturation"))
skin_diffuse_hsv_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_diffuse_hsv_strength"))
skin_cavity_ao_strength: bpy.props.FloatProperty(default=1, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_cavity_ao_strength"))
skin_blend_overlay_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_blend_overlay_strength"))
skin_ao_strength: bpy.props.FloatProperty(default=1, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_ao_strength"))
skin_ao_power: bpy.props.FloatProperty(default=1, min=0, max=8, update=lambda s,c: update_property(s,c,"skin_ao_power"))
skin_mouth_ao: bpy.props.FloatProperty(default=2.5, min=0, max=5, update=lambda s,c: update_property(s,c,"skin_mouth_ao"))
skin_nostril_ao: bpy.props.FloatProperty(default=2.5, min=0, max=5, update=lambda s,c: update_property(s,c,"skin_nostril_ao"))
skin_lips_ao: bpy.props.FloatProperty(default=2.5, min=0, max=5, update=lambda s,c: update_property(s,c,"skin_lips_ao"))
skin_subsurface_saturation: bpy.props.FloatProperty(default=1.5, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_subsurface_saturation"))
skin_subsurface_falloff: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 0.112, 0.072, 1.0), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"skin_subsurface_falloff"))
skin_subsurface_radius: bpy.props.FloatProperty(default=1.5, min=0, max=3, update=lambda s,c: update_property(s,c,"skin_subsurface_radius"))
skin_specular_scale: bpy.props.FloatProperty(default=0.4, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_specular_scale"))
skin_roughness_power: bpy.props.FloatProperty(default=0.8, min=0.01, max=2, update=lambda s,c: update_property(s,c,"skin_roughness_power"))
skin_roughness_min: bpy.props.FloatProperty(default=0.1, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_roughness_min"))
skin_roughness_max: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_roughness_max"))
# dual specular
skin_specular_detail_mask: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_detail_mask"))
skin_specular_detail_min: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_detail_min"))
skin_specular_detail_max: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_detail_max"))
skin_specular_detail_power: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_specular_detail_power"))
skin_secondary_specular_scale: bpy.props.FloatProperty(default=0.35, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_secondary_specular_scale"))
skin_secondary_roughness_power: bpy.props.FloatProperty(default=2.0, min=0.0, max=4.0, update=lambda s,c: update_property(s,c,"skin_secondary_roughness_power"))
skin_specular_mix: bpy.props.FloatProperty(default=0.4, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_mix"))
skin_normal_strength: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_normal_strength"))
skin_micro_normal_strength: bpy.props.FloatProperty(default=0.5, min=0, max=1.0, update=lambda s,c: update_property(s,c,"skin_micro_normal_strength"))
skin_normal_blend_strength: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_normal_blend_strength"))
skin_unmasked_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_unmasked_scatter_scale"))
skin_nose_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_nose_scatter_scale"))
skin_mouth_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_mouth_scatter_scale"))
skin_upper_lid_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_upper_lid_scatter_scale"))
skin_inner_lid_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_inner_lid_scatter_scale"))
skin_cheek_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_cheek_scatter_scale"))
skin_forehead_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_forehead_scatter_scale"))
skin_upper_lip_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_upper_lip_scatter_scale"))
skin_chin_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_chin_scatter_scale"))
skin_ear_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_ear_scatter_scale"))
skin_neck_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_neck_scatter_scale"))
skin_subsurface_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_subsurface_scale"))
skin_micro_roughness_mod: bpy.props.FloatProperty(default=0.05, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_micro_roughness_mod"))
skin_unmasked_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_unmasked_roughness_mod"))
skin_nose_roughness_mod: bpy.props.FloatProperty(default=0.119, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_nose_roughness_mod"))
skin_mouth_roughness_mod: bpy.props.FloatProperty(default=0.034, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_mouth_roughness_mod"))
skin_upper_lid_roughness_mod: bpy.props.FloatProperty(default=-0.3, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_upper_lid_roughness_mod"))
skin_inner_lid_roughness_mod: bpy.props.FloatProperty(default=-0.574, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_inner_lid_roughness_mod"))
skin_cheek_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_cheek_roughness_mod"))
skin_forehead_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_forehead_roughness_mod"))
skin_upper_lip_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_upper_lip_roughness_mod"))
skin_chin_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_chin_roughness_mod"))
skin_ear_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_ear_roughness_mod"))
skin_neck_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_neck_roughness_mod"))
skin_emissive_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"skin_emissive_color"))
skin_emission_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_emission_strength"))
# tiling (rl_head_shader_skin_micro_normal_tiling)
skin_micro_normal_tiling: bpy.props.FloatProperty(default=20, min=0, max=50, update=lambda s,c: update_property(s,c,"skin_micro_normal_tiling"))
skin_height_scale: bpy.props.FloatProperty(default=0.3, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_height_scale"))
skin_bump_scale: bpy.props.FloatProperty(default=0.3, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_bump_scale"))
skin_height_delta_scale: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_height_delta_scale"))
class CC3SkinParameters(bpy.types.PropertyGroup):
# shader (rl_skin_shader)
skin_diffuse_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1, 1, 1, 1), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"skin_diffuse_color"))
skin_diffuse_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_diffuse_hue"))
skin_diffuse_brightness: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_diffuse_brightness"))
skin_diffuse_saturation: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_diffuse_saturation"))
skin_diffuse_hsv_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_diffuse_hsv_strength"))
skin_ao_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_ao_strength"))
skin_ao_power: bpy.props.FloatProperty(default=1, min=0, max=8, update=lambda s,c: update_property(s,c,"skin_ao_power"))
skin_subsurface_saturation: bpy.props.FloatProperty(default=1.5, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_subsurface_saturation"))
skin_subsurface_falloff: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 0.112, 0.072, 1.0), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"skin_subsurface_falloff"))
skin_subsurface_radius: bpy.props.FloatProperty(default=1.5, min=0, max=3, update=lambda s,c: update_property(s,c,"skin_subsurface_radius"))
skin_specular_scale: bpy.props.FloatProperty(default=0.4, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_specular_scale"))
skin_roughness_power: bpy.props.FloatProperty(default=0.8, min=0.01, max=2, update=lambda s,c: update_property(s,c,"skin_roughness_power"))
skin_roughness_min: bpy.props.FloatProperty(default=0.1, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_roughness_min"))
skin_roughness_max: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_roughness_max"))
# dual specular
skin_specular_detail_mask: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_detail_mask"))
skin_specular_detail_min: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_detail_min"))
skin_specular_detail_max: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_detail_max"))
skin_specular_detail_power: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_specular_detail_power"))
skin_secondary_specular_scale: bpy.props.FloatProperty(default=0.35, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_secondary_specular_scale"))
skin_secondary_roughness_power: bpy.props.FloatProperty(default=2.0, min=0.0, max=4.0, update=lambda s,c: update_property(s,c,"skin_secondary_roughness_power"))
skin_specular_mix: bpy.props.FloatProperty(default=0.4, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_specular_mix"))
skin_normal_strength: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_normal_strength"))
skin_micro_normal_strength: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_micro_normal_strength"))
skin_subsurface_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_subsurface_scale"))
skin_unmasked_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_unmasked_scatter_scale"))
skin_r_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_r_scatter_scale"))
skin_g_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_g_scatter_scale"))
skin_b_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_b_scatter_scale"))
skin_a_scatter_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"skin_a_scatter_scale"))
skin_micro_roughness_mod: bpy.props.FloatProperty(default=0.05, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_micro_roughness_mod"))
skin_unmasked_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_unmasked_roughness_mod"))
skin_r_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_r_roughness_mod"))
skin_g_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_g_roughness_mod"))
skin_b_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_b_roughness_mod"))
skin_a_roughness_mod: bpy.props.FloatProperty(default=0, min=-1.5, max=1.5, update=lambda s,c: update_property(s,c,"skin_a_roughness_mod"))
skin_emissive_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"skin_emissive_color"))
skin_emission_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"skin_emission_strength"))
# tiling (rl_skin_shader_skin_micro_normal_tiling)
skin_micro_normal_tiling: bpy.props.FloatProperty(default=25, min=0, max=50, update=lambda s,c: update_property(s,c,"skin_micro_normal_tiling"))
skin_height_scale: bpy.props.FloatProperty(default=0.3, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_height_scale"))
skin_bump_scale: bpy.props.FloatProperty(default=0.3, min=0, max=2, update=lambda s,c: update_property(s,c,"skin_bump_scale"))
class CC3EyeParameters(bpy.types.PropertyGroup):
eye_subsurface_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_subsurface_scale"))
eye_subsurface_radius: bpy.props.FloatProperty(default=5.0, min=0.1, max=5, update=lambda s,c: update_property(s,c,"eye_subsurface_radius"))
eye_subsurface_falloff: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_subsurface_falloff"))
eye_cornea_specular: bpy.props.FloatProperty(default=0.8, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_cornea_specular"))
eye_iris_specular: bpy.props.FloatProperty(default=0.2, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_iris_specular"))
eye_sclera_roughness: bpy.props.FloatProperty(default=0.2, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_sclera_roughness"))
eye_iris_roughness: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_iris_roughness"))
eye_cornea_roughness: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_cornea_roughness"))
eye_ao_strength: bpy.props.FloatProperty(default=0.2, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_ao_strength"))
eye_sclera_scale: bpy.props.FloatProperty(default=1.0, min=0.25, max=2.0, update=lambda s,c: update_property(s,c,"eye_sclera_scale"))
eye_sclera_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_sclera_hue"))
eye_sclera_saturation: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_sclera_saturation"))
eye_sclera_brightness: bpy.props.FloatProperty(default=0.75, min=0, max=5, update=lambda s,c: update_property(s,c,"eye_sclera_brightness"))
eye_sclera_hsv: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_sclera_hsv"))
eye_iris_scale: bpy.props.FloatProperty(default=1.0, min=0.25, max=2.0, update=lambda s,c: update_property(s,c,"eye_iris_scale"))
eye_iris_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_iris_hue"))
eye_iris_saturation: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_iris_saturation"))
eye_iris_brightness: bpy.props.FloatProperty(default=1.0, min=0, max=5, update=lambda s,c: update_property(s,c,"eye_iris_brightness"))
eye_iris_hsv: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_iris_hsv"))
eye_iris_radius: bpy.props.FloatProperty(default=0.15, min=0.01, max=0.16, update=lambda s,c: update_property(s,c,"eye_iris_radius"))
eye_iris_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_iris_color"))
eye_sclera_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_sclera_color"))
eye_iris_inner_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_iris_inner_color"))
eye_iris_cloudy_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.0, 0.0, 0.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_iris_cloudy_color"))
eye_iris_inner_scale: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_iris_inner_scale"))
eye_iris_transmission_opacity: bpy.props.FloatProperty(default=0.85, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_iris_transmission_opacity"))
eye_limbus_width: bpy.props.FloatProperty(default=0.055, min=0.01, max=0.2, update=lambda s,c: update_property(s,c,"eye_limbus_width"))
eye_limbus_dark_radius: bpy.props.FloatProperty(default=0.13125, min=0.1, max=0.2, update=lambda s,c: update_property(s,c,"eye_limbus_dark_radius"))
eye_limbus_dark_width: bpy.props.FloatProperty(default=0.34375, min=0.01, max=0.99, update=lambda s,c: update_property(s,c,"eye_limbus_dark_width"))
eye_limbus_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.0, 0.0, 0.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_limbus_color"))
eye_shadow_radius: bpy.props.FloatProperty(default=0.3, min=0.0, max=0.5, update=lambda s,c: update_property(s,c,"eye_shadow_radius"))
eye_shadow_hardness: bpy.props.FloatProperty(default=0.5, min=0.01, max=0.99, update=lambda s,c: update_property(s,c,"eye_shadow_hardness"))
eye_corner_shadow_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 0.497, 0.445, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_corner_shadow_color"))
eye_color_blend_strength: bpy.props.FloatProperty(default=0.1, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_color_blend_strength"))
eye_sclera_emissive_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_sclera_emissive_color"))
eye_sclera_emission_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_sclera_emission_strength"))
eye_iris_emissive_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_iris_emissive_color"))
eye_iris_emission_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_iris_emission_strength"))
eye_sclera_normal_strength: bpy.props.FloatProperty(default=0.1, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_sclera_normal_strength"))
eye_sclera_normal_tiling: bpy.props.FloatProperty(default=2.0, min=0, max=10, update=lambda s,c: update_property(s,c,"eye_sclera_normal_tiling"))
# non shader properties
eye_refraction_depth: bpy.props.FloatProperty(default=1, min=0, max=5, update=lambda s,c: update_property(s,c,"eye_refraction_depth"))
eye_ior: bpy.props.FloatProperty(default=1.4, min=1.01, max=2.5, update=lambda s,c: update_property(s,c,"eye_ior"))
eye_blood_vessel_height: bpy.props.FloatProperty(default=0.5, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_blood_vessel_height"))
eye_iris_bump_height: bpy.props.FloatProperty(default=1, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_iris_bump_height"))
eye_iris_depth: bpy.props.FloatProperty(default=0.45, min=0, max=1.25, update=lambda s,c: update_property(s,c,"eye_iris_depth"))
eye_iris_depth_radius: bpy.props.FloatProperty(default=0.75, min=0.0, max=1.0, update=lambda s,c: update_property(s,c,"eye_iris_depth_radius"))
eye_pupil_scale: bpy.props.FloatProperty(default=0.8, min=0.5, max=4.0, update=lambda s,c: update_property(s,c,"eye_pupil_scale"))
class CC3EyeOcclusionParameters(bpy.types.PropertyGroup):
# Eye Occlusion Basic
eye_occlusion: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion"))
eye_occlusion_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.014451, 0.001628, 0.000837, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"eye_occlusion_color"))
eye_occlusion_hardness: bpy.props.FloatProperty(default=0.5, min=0.5, max=1.5, update=lambda s,c: update_property(s,c,"eye_occlusion_hardness"))
# Eye Occlusion Advanced
eye_occlusion_strength: bpy.props.FloatProperty(default=0.584, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_strength"))
eye_occlusion_power: bpy.props.FloatProperty(default=1.75, min=0.1, max=4, update=lambda s,c: update_property(s,c,"eye_occlusion_power"))
eye_occlusion_top_min: bpy.props.FloatProperty(default=0.27, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_top_min"))
eye_occlusion_top_range: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_top_range"))
eye_occlusion_top_curve: bpy.props.FloatProperty(default=0.7, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_occlusion_top_curve"))
eye_occlusion_bottom_min: bpy.props.FloatProperty(default=0.05, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_bottom_min"))
eye_occlusion_bottom_range: bpy.props.FloatProperty(default=0.335, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_bottom_range"))
eye_occlusion_bottom_curve: bpy.props.FloatProperty(default=2.0, min=0, max=2, update=lambda s,c: update_property(s,c,"eye_occlusion_bottom_curve"))
eye_occlusion_inner_min: bpy.props.FloatProperty(default=0.25, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_inner_min"))
eye_occlusion_inner_range: bpy.props.FloatProperty(default=0.625, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_inner_range"))
eye_occlusion_outer_min: bpy.props.FloatProperty(default=0.2, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_outer_min"))
eye_occlusion_outer_range: bpy.props.FloatProperty(default=0.6, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_outer_range"))
eye_occlusion_strength2: bpy.props.FloatProperty(default=0.766, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_strength2"))
eye_occlusion_top2_min: bpy.props.FloatProperty(default=0.15, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_top2_min"))
eye_occlusion_top2_range: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_top2_range"))
eye_occlusion_tear_duct_position: bpy.props.FloatProperty(default=0.8, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_tear_duct_position"))
eye_occlusion_tear_duct_width: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"eye_occlusion_tear_duct_width"))
eye_occlusion_inner: bpy.props.FloatProperty(default=0, min=-0.2, max=0.2, update=lambda s,c: update_property(s,c,"eye_occlusion_inner"))
eye_occlusion_outer: bpy.props.FloatProperty(default=0, min=-0.2, max=0.2, update=lambda s,c: update_property(s,c,"eye_occlusion_outer"))
eye_occlusion_top: bpy.props.FloatProperty(default=0, min=-0.2, max=0.2, update=lambda s,c: update_property(s,c,"eye_occlusion_top"))
eye_occlusion_bottom: bpy.props.FloatProperty(default=0, min=-0.2, max=0.2, update=lambda s,c: update_property(s,c,"eye_occlusion_bottom"))
eye_occlusion_displace: bpy.props.FloatProperty(default=0.02, min=-0.1, max=0.1, update=lambda s,c: update_property(s,c,"eye_occlusion_displace"))
class CC3TearlineParameters(bpy.types.PropertyGroup):
# Tearline
tearline_specular: bpy.props.FloatProperty(default=1.0, min=0, max=2.0, update=lambda s,c: update_property(s,c,"tearline_specular"))
tearline_glossiness: bpy.props.FloatProperty(default=0.85, min=0, max=1.0, update=lambda s,c: update_property(s,c,"tearline_glossiness"))
tearline_alpha: bpy.props.FloatProperty(default=0.05, min=0, max=0.2, update=lambda s,c: update_property(s,c,"tearline_alpha"))
tearline_roughness: bpy.props.FloatProperty(default=0.15, min=0, max=0.5, update=lambda s,c: update_property(s,c,"tearline_roughness"))
tearline_inner: bpy.props.FloatProperty(default=0, min=-0.2, max=0.2, update=lambda s,c: update_property(s,c,"tearline_inner"))
tearline_displace: bpy.props.FloatProperty(default=0.1, min=-0.2, max=0.2, update=lambda s,c: update_property(s,c,"tearline_displace"))
class CC3TeethParameters(bpy.types.PropertyGroup):
# Teeth
teeth_gums_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_gums_hue"))
teeth_gums_brightness: bpy.props.FloatProperty(default=0.9, min=0, max=5, update=lambda s,c: update_property(s,c,"teeth_gums_brightness"))
teeth_gums_saturation: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"teeth_gums_saturation"))
teeth_gums_hsv_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_gums_hsv_strength"))
teeth_teeth_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_teeth_hue"))
teeth_teeth_brightness: bpy.props.FloatProperty(default=0.7, min=0, max=5, update=lambda s,c: update_property(s,c,"teeth_teeth_brightness"))
teeth_teeth_saturation: bpy.props.FloatProperty(default=0.9, min=0, max=2, update=lambda s,c: update_property(s,c,"teeth_teeth_saturation"))
teeth_teeth_hsv_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_teeth_hsv_strength"))
teeth_front_ao: bpy.props.FloatProperty(default=1.0, min=0, max=1.5, update=lambda s,c: update_property(s,c,"teeth_front_ao"))
teeth_rear_ao: bpy.props.FloatProperty(default=0.0, min=0, max=1.5, update=lambda s,c: update_property(s,c,"teeth_rear_ao"))
teeth_ao_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_ao_strength"))
teeth_ao_power: bpy.props.FloatProperty(default=1, min=0, max=8, update=lambda s,c: update_property(s,c,"teeth_ao_power"))
teeth_gums_subsurface_scatter: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_gums_subsurface_scatter"))
teeth_teeth_subsurface_scatter: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_teeth_subsurface_scatter"))
teeth_subsurface_radius: bpy.props.FloatProperty(default=1.0, min=0.1, max=3, update=lambda s,c: update_property(s,c,"teeth_subsurface_radius"))
teeth_subsurface_falloff: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.381, 0.198, 0.13, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"teeth_subsurface_falloff"))
teeth_front_specular: bpy.props.FloatProperty(default=0.1, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_front_specular"))
teeth_rear_specular: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_rear_specular"))
teeth_front_roughness: bpy.props.FloatProperty(default=0.4, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_front_roughness"))
teeth_rear_roughness: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_rear_roughness"))
teeth_normal_strength: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"teeth_normal_strength"))
teeth_micro_normal_strength: bpy.props.FloatProperty(default=0.3, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_micro_normal_strength"))
teeth_micro_normal_tiling: bpy.props.FloatProperty(default=10, min=0, max=20, update=lambda s,c: update_property(s,c,"teeth_micro_normal_tiling"))
teeth_emissive_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"teeth_emissive_color"))
teeth_emission_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"teeth_emission_strength"))
class CC3TongueParameters(bpy.types.PropertyGroup):
# Tongue
tongue_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_hue"))
tongue_brightness: bpy.props.FloatProperty(default=1, min=0, max=2, update=lambda s,c: update_property(s,c,"tongue_brightness"))
tongue_saturation: bpy.props.FloatProperty(default=0.95, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_saturation"))
tongue_hsv_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_hsv_strength"))
tongue_front_ao: bpy.props.FloatProperty(default=1.0, min=0, max=1.5, update=lambda s,c: update_property(s,c,"tongue_front_ao"))
tongue_rear_ao: bpy.props.FloatProperty(default=0.0, min=0, max=1.5, update=lambda s,c: update_property(s,c,"tongue_rear_ao"))
tongue_ao_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_ao_strength"))
tongue_ao_power: bpy.props.FloatProperty(default=1, min=0, max=8, update=lambda s,c: update_property(s,c,"tongue_ao_power"))
tongue_subsurface_scatter: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"tongue_subsurface_scatter"))
tongue_subsurface_radius: bpy.props.FloatProperty(default=1.0, min=0.1, max=5, update=lambda s,c: update_property(s,c,"tongue_subsurface_radius"))
tongue_subsurface_falloff: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 0.112, 0.072, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"tongue_subsurface_falloff"))
tongue_front_specular: bpy.props.FloatProperty(default=0.259, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_front_specular"))
tongue_rear_specular: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_rear_specular"))
tongue_front_roughness: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_front_roughness"))
tongue_rear_roughness: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_rear_roughness"))
tongue_normal_strength: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"tongue_normal_strength"))
tongue_micro_normal_strength: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_micro_normal_strength"))
tongue_micro_normal_tiling: bpy.props.FloatProperty(default=4, min=0, max=20, update=lambda s,c: update_property(s,c,"tongue_micro_normal_tiling"))
tongue_emissive_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"tongue_emissive_color"))
tongue_emission_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"tongue_emission_strength"))
class CC3HairParameters(bpy.types.PropertyGroup):
# shader
hair_diffuse_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1, 1, 1, 1), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"hair_diffuse_color"))
hair_diffuse_hue: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_diffuse_hue"))
hair_diffuse_brightness: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_diffuse_brightness"))
hair_diffuse_saturation: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_diffuse_saturation"))
hair_diffuse_hsv_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_diffuse_hsv_strength"))
hair_global_strength: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_global_strength"))
hair_root_color_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_root_color_strength"))
hair_end_color_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_end_color_strength"))
hair_invert_root_map: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_invert_root_map"))
hair_base_color_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_base_color_strength"))
hair_root_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.144129, 0.072272, 0.046665, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_root_color"))
hair_end_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.332452, 0.184475, 0.122139, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_end_color"))
hair_highlight_a_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.502886, 0.323143, 0.205079, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_highlight_a_color"))
hair_highlight_a_start: bpy.props.FloatProperty(default=0.1, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_a_start"))
hair_highlight_a_mid: bpy.props.FloatProperty(default=0.2, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_a_mid"))
hair_highlight_a_end: bpy.props.FloatProperty(default=0.3, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_a_end"))
hair_highlight_a_strength: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_a_strength"))
hair_highlight_a_overlap_invert: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_a_overlap_invert"))
hair_highlight_a_overlap_end: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_a_overlap_end"))
hair_highlight_b_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1, 1, 1, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_highlight_b_color"))
hair_highlight_b_start: bpy.props.FloatProperty(default=0.1, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_b_start"))
hair_highlight_b_mid: bpy.props.FloatProperty(default=0.2, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_b_mid"))
hair_highlight_b_end: bpy.props.FloatProperty(default=0.3, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_b_end"))
hair_highlight_b_strength: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_b_strength"))
hair_highlight_b_overlap_invert: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_b_overlap_invert"))
hair_highlight_b_overlap_end: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_highlight_b_overlap_end"))
hair_vertex_color_strength: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_vertex_color_strength"))
hair_vertex_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0, 0, 0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_vertex_color"))
hair_anisotropic_roughness: bpy.props.FloatProperty(default=0.0375, min=0.0, max=0.15, update=lambda s,c: update_property(s,c,"hair_anisotropic_roughness"))
hair_anisotropic_shift_min: bpy.props.FloatProperty(default=0, min=-1, max=1, update=lambda s,c: update_property(s,c,"hair_anisotropic_shift_min"))
hair_anisotropic_shift_max: bpy.props.FloatProperty(default=0, min=-1, max=1, update=lambda s,c: update_property(s,c,"hair_anisotropic_shift_max"))
hair_anisotropic: bpy.props.FloatProperty(default=1, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_anisotropic"))
hair_anisotropic_strength: bpy.props.FloatProperty(default=0.8, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_anisotropic_strength"))
hair_specular_blend: bpy.props.FloatProperty(default=0.75, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_specular_blend"))
hair_anisotropic_strength2: bpy.props.FloatProperty(default=0.4, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_anisotropic_strength2"))
hair_anisotropic_strength_cycles: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_anisotropic_strength_cycles"))
hair_anisotropic_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(0.05, 0.038907, 0.0325, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_anisotropic_color"))
hair_subsurface_scale: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_subsurface_scale"))
hair_subsurface_saturation: bpy.props.FloatProperty(default=1.5, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_subsurface_saturation"))
hair_subsurface_falloff: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_subsurface_falloff"))
hair_subsurface_radius: bpy.props.FloatProperty(default=1.0, min=0.1, max=5, update=lambda s,c: update_property(s,c,"hair_subsurface_radius"))
hair_diffuse_strength: bpy.props.FloatProperty(default=1.0, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_diffuse_strength"))
hair_ao_strength: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_ao_strength"))
hair_ao_power: bpy.props.FloatProperty(default=1, min=0, max=8, update=lambda s,c: update_property(s,c,"hair_ao_power"))
hair_ao_occlude_all: bpy.props.FloatProperty(default=0.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_ao_occlude_all"))
hair_blend_multiply_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_blend_multiply_strength"))
hair_specular_scale: bpy.props.FloatProperty(default=0.3, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_specular_scale"))
hair_roughness_strength: bpy.props.FloatProperty(default=0.5, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_roughness_strength"))
hair_alpha_strength: bpy.props.FloatProperty(default=1, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_alpha_strength"))
hair_alpha_power: bpy.props.FloatProperty(default=1, min=0.01, max=2, update=lambda s,c: update_property(s,c,"hair_alpha_power"))
hair_opacity: bpy.props.FloatProperty(default=1, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_opacity"))
hair_normal_strength: bpy.props.FloatProperty(default=1, min=0, max=2, update=lambda s,c: update_property(s,c,"hair_normal_strength"))
hair_bump_strength: bpy.props.FloatProperty(default=1, min=-3, max=3, update=lambda s,c: update_property(s,c,"hair_bump_strength"))
hair_displacement_strength: bpy.props.FloatProperty(default=0, min=-3, max=3, update=lambda s,c: update_property(s,c,"hair_displacement_strength"))
hair_emissive_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1.0, 1.0, 1.0, 1.0), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"hair_emissive_color"))
hair_emission_strength: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_emission_strength"))
# not done yet
hair_enable_color: bpy.props.FloatProperty(default=0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_enable_color"))
hair_tangent_vector: bpy.props.FloatVectorProperty(subtype="XYZ", size=3,
default=(0.0, 1.0, 0.0), min = -1.0, max = 1.0, update=lambda s,c: update_property(s,c,"hair_tangent_vector"))
hair_tangent_flip_green: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_tangent_flip_green"))
hair_specular_scale2: bpy.props.FloatProperty(default=1.0, min=0, max=1, update=lambda s,c: update_property(s,c,"hair_specular_scale2"))
class CC3PBRParameters(bpy.types.PropertyGroup):
# Default
default_diffuse_color: bpy.props.FloatVectorProperty(subtype="COLOR", size=4,
default=(1, 1, 1, 1), min = 0.0, max = 1.0,
update=lambda s,c: update_property(s,c,"default_diffuse_color"))