moved code from root to /src
This commit is contained in:
parent
46363150d0
commit
8984e75bee
7 changed files with 2 additions and 2 deletions
16
src/panels/panel.py
Normal file
16
src/panels/panel.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import bpy
|
||||
|
||||
|
||||
class BakeToIDMapPanel(bpy.types.Panel):
|
||||
bl_idname = "PANEL.BAKE_TO_ID_MAP_PT_SETTINGS"
|
||||
bl_label = "Bake to ID Map"
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "Tool"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
layout.use_property_decorate = False # No animation.
|
||||
|
||||
self.layout.operator("object.bake_to_id_map", text="Bake")
|
||||
24
src/panels/panel_advanced.py
Normal file
24
src/panels/panel_advanced.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import math
|
||||
|
||||
import bpy
|
||||
|
||||
|
||||
class BakeToIDAdvancedMenu(bpy.types.Panel):
|
||||
bl_idname = "PANEL.BAKE_TO_ID_MAP_PT_SETTINGS_ADVANCED"
|
||||
bl_parent_id = "PANEL.BAKE_TO_ID_MAP_PT_SETTINGS"
|
||||
bl_label = "Advanced"
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "Tool"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
props = context.scene.bake_to_id_props
|
||||
layout.label(text="Colors")
|
||||
layout.prop(props, "adv_total_hues")
|
||||
layout.prop(props, "adv_total_satuations")
|
||||
layout.prop(props, "adv_total_brightnesses")
|
||||
layout.label(text="Max ID-count: " + str(
|
||||
math.pow(math.pow(props.adv_total_hues, props.adv_total_satuations), props.adv_total_brightnesses)))
|
||||
20
src/panels/panel_info.py
Normal file
20
src/panels/panel_info.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import bpy
|
||||
|
||||
from .. operators.bake_to_id_map import BakeToIDMapOperator
|
||||
|
||||
|
||||
class BakeToIDInfoPanel(bpy.types.Panel):
|
||||
bl_idname = "PANEL.BAKE_TO_ID_MAP_PT_SETTINGS_INFO"
|
||||
bl_parent_id = "PANEL.BAKE_TO_ID_MAP_PT_SETTINGS"
|
||||
bl_label = "Infos"
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "Tool"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
props = context.scene.bake_to_id_props
|
||||
|
||||
layout.label(text="Selected Object-Count: " + str(len(context.selected_objects)))
|
||||
layout.label(text="Estimated ID-Count: " + str(BakeToIDMapOperator.count_ids(context, props)))
|
||||
45
src/panels/panel_options.py
Normal file
45
src/panels/panel_options.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import bpy
|
||||
|
||||
|
||||
class BakeToIDOptionsPanel(bpy.types.Panel):
|
||||
bl_idname = "PANEL.BAKE_TO_ID_MAP_PT_SETTINGS_OPTIONS"
|
||||
bl_parent_id = "PANEL.BAKE_TO_ID_MAP_PT_SETTINGS"
|
||||
bl_label = "Options"
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "Tool"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
props = context.scene.bake_to_id_props
|
||||
|
||||
layout.prop(props, "source")
|
||||
source_settings_box = layout.box()
|
||||
source_settings = self.get_source_settings(props)
|
||||
for setting in source_settings:
|
||||
source_settings_box.prop(props, setting)
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(props, "target")
|
||||
target_settings_box = layout.box()
|
||||
target_settings = self.get_target_settings(props)
|
||||
for setting in target_settings:
|
||||
target_settings_box.prop(props, setting)
|
||||
|
||||
def get_source_settings(self, props):
|
||||
if props.source == 'MATERIAL_INDEX':
|
||||
return [
|
||||
'source_materials_remove_all'
|
||||
]
|
||||
|
||||
return []
|
||||
|
||||
def get_target_settings(self, props):
|
||||
if props.target == 'VERTEX_COLORS':
|
||||
return [
|
||||
'target_vertex_color_attribute_name'
|
||||
]
|
||||
|
||||
return []
|
||||
Loading…
Add table
Add a link
Reference in a new issue