Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_texture.py
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
| class TextureButtonsPanel: | class TextureButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "texture" | bl_context = "texture" | ||||
| class TEXTURE_PT_preview(TextureButtonsPanel, Panel): | class TEXTURE_PT_preview(TextureButtonsPanel, Panel): | ||||
| bl_label = "Preview" | bl_label = "Preview" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.engine in cls.COMPAT_ENGINES) | return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 12 Lines | def draw(self, context): | ||||
| if isinstance(idblock, Brush): | if isinstance(idblock, Brush): | ||||
| layout.prop(tex, "use_preview_alpha") | layout.prop(tex, "use_preview_alpha") | ||||
| class TEXTURE_PT_context(TextureButtonsPanel, Panel): | class TEXTURE_PT_context(TextureButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_context = "texture" | bl_context = "texture" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| tex = context.texture | tex = context.texture | ||||
| space = context.space_data | space = context.space_data | ||||
| pin_id = space.pin_id | pin_id = space.pin_id | ||||
| use_pin_id = space.use_pin_id | use_pin_id = space.use_pin_id | ||||
| Show All 22 Lines | def draw(self, context): | ||||
| split = col.split(factor=0.2) | split = col.split(factor=0.2) | ||||
| split.label(text="Type") | split.label(text="Type") | ||||
| split.prop(tex, "type", text="") | split.prop(tex, "type", text="") | ||||
| class TEXTURE_PT_node(TextureButtonsPanel, Panel): | class TEXTURE_PT_node(TextureButtonsPanel, Panel): | ||||
| bl_label = "Node" | bl_label = "Node" | ||||
| bl_context = "texture" | bl_context = "texture" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| node = context.texture_node | node = context.texture_node | ||||
| return node and (context.engine in cls.COMPAT_ENGINES) | return node and (context.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 12 Lines | def poll(cls, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| engine = context.engine | engine = context.engine | ||||
| return tex and ((tex.type == cls.tex_type and not tex.use_nodes) and (engine in cls.COMPAT_ENGINES)) | return tex and ((tex.type == cls.tex_type and not tex.use_nodes) and (engine in cls.COMPAT_ENGINES)) | ||||
| class TEXTURE_PT_clouds(TextureTypePanel, Panel): | class TEXTURE_PT_clouds(TextureTypePanel, Panel): | ||||
| bl_label = "Clouds" | bl_label = "Clouds" | ||||
| tex_type = 'CLOUDS' | tex_type = 'CLOUDS' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| tex = context.texture | tex = context.texture | ||||
| Show All 15 Lines | def draw(self, context): | ||||
| col.prop(tex, "noise_scale", text="Size") | col.prop(tex, "noise_scale", text="Size") | ||||
| col.prop(tex, "noise_depth", text="Depth") | col.prop(tex, "noise_depth", text="Depth") | ||||
| col.prop(tex, "nabla", text="Nabla") | col.prop(tex, "nabla", text="Nabla") | ||||
| class TEXTURE_PT_wood(TextureTypePanel, Panel): | class TEXTURE_PT_wood(TextureTypePanel, Panel): | ||||
| bl_label = "Wood" | bl_label = "Wood" | ||||
| tex_type = 'WOOD' | tex_type = 'WOOD' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=False) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=False) | ||||
| tex = context.texture | tex = context.texture | ||||
| Show All 20 Lines | def draw(self, context): | ||||
| sub.prop(tex, "noise_scale", text="Size") | sub.prop(tex, "noise_scale", text="Size") | ||||
| sub.prop(tex, "turbulence") | sub.prop(tex, "turbulence") | ||||
| sub.prop(tex, "nabla") | sub.prop(tex, "nabla") | ||||
| class TEXTURE_PT_marble(TextureTypePanel, Panel): | class TEXTURE_PT_marble(TextureTypePanel, Panel): | ||||
| bl_label = "Marble" | bl_label = "Marble" | ||||
| tex_type = 'MARBLE' | tex_type = 'MARBLE' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| tex = context.texture | tex = context.texture | ||||
| Show All 17 Lines | def draw(self, context): | ||||
| col.prop(tex, "noise_depth", text="Depth") | col.prop(tex, "noise_depth", text="Depth") | ||||
| col.prop(tex, "turbulence") | col.prop(tex, "turbulence") | ||||
| col.prop(tex, "nabla") | col.prop(tex, "nabla") | ||||
| class TEXTURE_PT_magic(TextureTypePanel, Panel): | class TEXTURE_PT_magic(TextureTypePanel, Panel): | ||||
| bl_label = "Magic" | bl_label = "Magic" | ||||
| tex_type = 'MAGIC' | tex_type = 'MAGIC' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | ||||
| tex = context.texture | tex = context.texture | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(tex, "noise_depth", text="Depth") | col.prop(tex, "noise_depth", text="Depth") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(tex, "turbulence") | col.prop(tex, "turbulence") | ||||
| class TEXTURE_PT_blend(TextureTypePanel, Panel): | class TEXTURE_PT_blend(TextureTypePanel, Panel): | ||||
| bl_label = "Blend" | bl_label = "Blend" | ||||
| tex_type = 'BLEND' | tex_type = 'BLEND' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| tex = context.texture | tex = context.texture | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(tex, "progression") | col.prop(tex, "progression") | ||||
| col.separator() | col.separator() | ||||
| col = flow.column() | col = flow.column() | ||||
| col.active = (tex.progression in {'LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'}) | col.active = (tex.progression in {'LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'}) | ||||
| col.prop(tex, "use_flip_axis", text="Orientation") | col.prop(tex, "use_flip_axis", text="Orientation") | ||||
| class TEXTURE_PT_stucci(TextureTypePanel, Panel): | class TEXTURE_PT_stucci(TextureTypePanel, Panel): | ||||
| bl_label = "Stucci" | bl_label = "Stucci" | ||||
| tex_type = 'STUCCI' | tex_type = 'STUCCI' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | ||||
| tex = context.texture | tex = context.texture | ||||
| Show All 14 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(tex, "noise_scale", text="Size") | col.prop(tex, "noise_scale", text="Size") | ||||
| col.prop(tex, "turbulence") | col.prop(tex, "turbulence") | ||||
| class TEXTURE_PT_image(TextureTypePanel, Panel): | class TEXTURE_PT_image(TextureTypePanel, Panel): | ||||
| bl_label = "Image" | bl_label = "Image" | ||||
| tex_type = 'IMAGE' | tex_type = 'IMAGE' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, _context): | def draw(self, _context): | ||||
| # TODO: maybe expose the template_ID from the template image here. | # TODO: maybe expose the template_ID from the template image here. | ||||
| layout = self.layout | layout = self.layout | ||||
| del layout | del layout | ||||
| class TEXTURE_PT_image_settings(TextureTypePanel, Panel): | class TEXTURE_PT_image_settings(TextureTypePanel, Panel): | ||||
| bl_label = "Settings" | bl_label = "Settings" | ||||
| bl_parent_id = 'TEXTURE_PT_image' | bl_parent_id = 'TEXTURE_PT_image' | ||||
| tex_type = 'IMAGE' | tex_type = 'IMAGE' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| tex = context.texture | tex = context.texture | ||||
| layout.template_image(tex, "image", tex.image_user) | layout.template_image(tex, "image", tex.image_user) | ||||
| ▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col = flow.column(align=True) | col = flow.column(align=True) | ||||
| col.prop(tex, "crop_max_x", text="Maximum X") | col.prop(tex, "crop_max_x", text="Maximum X") | ||||
| col.prop(tex, "crop_max_y", text="Y") | col.prop(tex, "crop_max_y", text="Y") | ||||
| class TEXTURE_PT_musgrave(TextureTypePanel, Panel): | class TEXTURE_PT_musgrave(TextureTypePanel, Panel): | ||||
| bl_label = "Musgrave" | bl_label = "Musgrave" | ||||
| tex_type = 'MUSGRAVE' | tex_type = 'MUSGRAVE' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| tex = context.texture | tex = context.texture | ||||
| Show All 28 Lines | def draw(self, context): | ||||
| if musgrave_type in {'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}: | if musgrave_type in {'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}: | ||||
| col.prop(tex, "gain") | col.prop(tex, "gain") | ||||
| class TEXTURE_PT_voronoi(TextureTypePanel, Panel): | class TEXTURE_PT_voronoi(TextureTypePanel, Panel): | ||||
| bl_label = "Voronoi" | bl_label = "Voronoi" | ||||
| tex_type = 'VORONOI' | tex_type = 'VORONOI' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) | ||||
| tex = context.texture | tex = context.texture | ||||
| Show All 16 Lines | def draw(self, context): | ||||
| col.prop(tex, "noise_scale", text="Size") | col.prop(tex, "noise_scale", text="Size") | ||||
| col.prop(tex, "nabla") | col.prop(tex, "nabla") | ||||
| class TEXTURE_PT_voronoi_feature_weights(TextureTypePanel, Panel): | class TEXTURE_PT_voronoi_feature_weights(TextureTypePanel, Panel): | ||||
| bl_label = "Feature Weights" | bl_label = "Feature Weights" | ||||
| bl_parent_id = "TEXTURE_PT_voronoi" | bl_parent_id = "TEXTURE_PT_voronoi" | ||||
| tex_type = 'VORONOI' | tex_type = 'VORONOI' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| tex = context.texture | tex = context.texture | ||||
| col = flow.column(align=True) | col = flow.column(align=True) | ||||
| col.prop(tex, "weight_1", text="First", slider=True) | col.prop(tex, "weight_1", text="First", slider=True) | ||||
| col.prop(tex, "weight_2", text="Second", slider=True) | col.prop(tex, "weight_2", text="Second", slider=True) | ||||
| sub = flow.column(align=True) | sub = flow.column(align=True) | ||||
| sub.prop(tex, "weight_3", text="Third", slider=True) | sub.prop(tex, "weight_3", text="Third", slider=True) | ||||
| sub.prop(tex, "weight_4", text="Fourth", slider=True) | sub.prop(tex, "weight_4", text="Fourth", slider=True) | ||||
| class TEXTURE_PT_distortednoise(TextureTypePanel, Panel): | class TEXTURE_PT_distortednoise(TextureTypePanel, Panel): | ||||
| bl_label = "Distorted Noise" | bl_label = "Distorted Noise" | ||||
| tex_type = 'DISTORTED_NOISE' | tex_type = 'DISTORTED_NOISE' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| tex = context.texture | tex = context.texture | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(tex, "noise_basis", text="Noise Basis") | col.prop(tex, "noise_basis", text="Noise Basis") | ||||
| col.separator() | col.separator() | ||||
| col.prop(tex, "noise_distortion", text="Distortion") | col.prop(tex, "noise_distortion", text="Distortion") | ||||
| col.separator() | col.separator() | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(tex, "distortion", text="Amount") | col.prop(tex, "distortion", text="Amount") | ||||
| col.prop(tex, "noise_scale", text="Size") | col.prop(tex, "noise_scale", text="Size") | ||||
| col.prop(tex, "nabla") | col.prop(tex, "nabla") | ||||
| class TextureSlotPanel(TextureButtonsPanel): | class TextureSlotPanel(TextureButtonsPanel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| if not hasattr(context, "texture_slot"): | if not hasattr(context, "texture_slot"): | ||||
| return False | return False | ||||
| return (context.engine in cls.COMPAT_ENGINES) | return (context.engine in cls.COMPAT_ENGINES) | ||||
| class TEXTURE_PT_mapping(TextureSlotPanel, Panel): | class TEXTURE_PT_mapping(TextureSlotPanel, Panel): | ||||
| bl_label = "Mapping" | bl_label = "Mapping" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| idblock = context_tex_datablock(context) | idblock = context_tex_datablock(context) | ||||
| if isinstance(idblock, Brush) and not context.sculpt_object: | if isinstance(idblock, Brush) and not context.sculpt_object: | ||||
| return False | return False | ||||
| if not getattr(context, "texture_slot", None): | if not getattr(context, "texture_slot", None): | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col = flow.column(align=True) | col = flow.column(align=True) | ||||
| col.column().prop(tex, "scale") | col.column().prop(tex, "scale") | ||||
| class TEXTURE_PT_influence(TextureSlotPanel, Panel): | class TEXTURE_PT_influence(TextureSlotPanel, Panel): | ||||
| bl_label = "Influence" | bl_label = "Influence" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| idblock = context_tex_datablock(context) | idblock = context_tex_datablock(context) | ||||
| if isinstance(idblock, Brush): | if isinstance(idblock, Brush): | ||||
| return False | return False | ||||
| if not getattr(context, "texture_slot", None): | if not getattr(context, "texture_slot", None): | ||||
| ▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | class TextureColorsPoll: | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.engine in cls.COMPAT_ENGINES) | return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.engine in cls.COMPAT_ENGINES) | ||||
| class TEXTURE_PT_colors(TextureButtonsPanel, TextureColorsPoll, Panel): | class TEXTURE_PT_colors(TextureButtonsPanel, TextureColorsPoll, Panel): | ||||
| bl_label = "Colors" | bl_label = "Colors" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=False) | flow = layout.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=False) | ||||
| tex = context.texture | tex = context.texture | ||||
| Show All 12 Lines | def draw(self, context): | ||||
| col.prop(tex, "contrast") | col.prop(tex, "contrast") | ||||
| col.prop(tex, "saturation") | col.prop(tex, "saturation") | ||||
| class TEXTURE_PT_colors_ramp(TextureButtonsPanel, TextureColorsPoll, Panel): | class TEXTURE_PT_colors_ramp(TextureButtonsPanel, TextureColorsPoll, Panel): | ||||
| bl_label = "Color Ramp" | bl_label = "Color Ramp" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| bl_parent_id = 'TEXTURE_PT_colors' | bl_parent_id = 'TEXTURE_PT_colors' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| self.layout.prop(tex, "use_color_ramp", text="") | self.layout.prop(tex, "use_color_ramp", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| tex = context.texture | tex = context.texture | ||||
| # Note: TODO after creation of a new texture, the template_color_ramp will be blank. | # Note: TODO after creation of a new texture, the template_color_ramp will be blank. | ||||
| # Possibly needs to be fixed in the template itself. | # Possibly needs to be fixed in the template itself. | ||||
| is_active = bool(tex and tex.use_color_ramp) | is_active = bool(tex and tex.use_color_ramp) | ||||
| if is_active: | if is_active: | ||||
| layout.template_color_ramp(tex, "color_ramp", expand=True) | layout.template_color_ramp(tex, "color_ramp", expand=True) | ||||
| else: | else: | ||||
| layout.label(text="Enable the Color Ramp first") | layout.label(text="Enable the Color Ramp first") | ||||
| class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel): | class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| _context_path = "texture" | _context_path = "texture" | ||||
| _property_type = Texture | _property_type = Texture | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.texture and (context.engine in cls.COMPAT_ENGINES) | return context.texture and (context.engine in cls.COMPAT_ENGINES) | ||||
| Show All 33 Lines | |||||