forked from heme3ic/Blender-BakeLab2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bakelab_baked_data.py
49 lines (43 loc) · 1.19 KB
/
bakelab_baked_data.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
import bpy
from . import bakelab_map
from bpy.types import (
Operator,
PropertyGroup,
Panel
)
from bpy.props import (
IntProperty,
EnumProperty,
BoolProperty,
FloatProperty,
StringProperty,
PointerProperty,
CollectionProperty
)
class BakeObjData(PropertyGroup):
obj : PointerProperty(
type=bpy.types.Object
)
class BakeMapData(PropertyGroup):
bake_map : PointerProperty(
type=bakelab_map.BakeLabMap
)
image : PointerProperty(
type=bpy.types.Image
)
class BakeLab_BakedData(PropertyGroup):
obj_list : CollectionProperty(
type=BakeObjData
)
map_list : CollectionProperty(
type=BakeMapData
)
def AddObj(self, obj):
item = self.obj_list.add()
item.obj = obj
def AddMap(self, bake_map, image):
item = self.map_list.add()
item.bake_map.type = bake_map.type
item.bake_map.pass_name = bake_map.pass_name
item.bake_map.normal_space = bake_map.normal_space
item.image = image