Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_texture.py
| Show First 20 Lines • Show All 119 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" | ||||
| @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.scene.render.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_context_texture(TextureButtonsPanel, Panel): | class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| # if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")): | # if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")): | ||||
| # return False | # return False | ||||
| return ((context.material or | return ((context.material or | ||||
| context.world or | context.world or | ||||
| context.lamp or | context.lamp or | ||||
| context.texture or | context.texture or | ||||
| context.line_style or | context.line_style or | ||||
| context.particle_system or | context.particle_system or | ||||
| ▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | |||||
| class TextureSlotPanel(TextureButtonsPanel): | class TextureSlotPanel(TextureButtonsPanel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @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 | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return TextureButtonsPanel.poll(cls, context) and (engine in cls.COMPAT_ENGINES) | return TextureButtonsPanel.poll(cls, context) and (engine in cls.COMPAT_ENGINES) | ||||
| # Texture Type Panels # | # Texture Type Panels # | ||||
| class TextureTypePanel(TextureButtonsPanel): | class TextureTypePanel(TextureButtonsPanel): | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| engine = context.scene.render.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_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| ▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
| class TEXTURE_PT_image_sampling(TextureTypePanel, Panel): | class TEXTURE_PT_image_sampling(TextureTypePanel, Panel): | ||||
| bl_label = "Image Sampling" | bl_label = "Image Sampling" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| tex_type = 'IMAGE' | tex_type = 'IMAGE' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| if context.scene.render.engine == 'BLENDER_GAME': | if context.engine == 'BLENDER_GAME': | ||||
| self.draw_bge(context) | self.draw_bge(context) | ||||
| else: | else: | ||||
| self.draw_bi(context) | self.draw_bi(context) | ||||
| def draw_bi(self, context): | def draw_bi(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| idblock = context_tex_datablock(context) | idblock = context_tex_datablock(context) | ||||
| ▲ Show 20 Lines • Show All 265 Lines • ▼ Show 20 Lines | |||||
| class TEXTURE_PT_voxeldata(TextureButtonsPanel, Panel): | class TEXTURE_PT_voxeldata(TextureButtonsPanel, Panel): | ||||
| bl_label = "Voxel Data" | bl_label = "Voxel Data" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return tex and (tex.type == 'VOXEL_DATA' and (engine in cls.COMPAT_ENGINES)) | return tex and (tex.type == 'VOXEL_DATA' and (engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| tex = context.texture | tex = context.texture | ||||
| vd = tex.voxel_data | vd = tex.voxel_data | ||||
| Show All 26 Lines | |||||
| class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel): | class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel): | ||||
| bl_label = "Point Density" | bl_label = "Point Density" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return tex and (tex.type == 'POINT_DENSITY' and (engine in cls.COMPAT_ENGINES)) | return tex and (tex.type == 'POINT_DENSITY' and (engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| tex = context.texture | tex = context.texture | ||||
| pd = tex.point_density | pd = tex.point_density | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
| class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, Panel): | class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, Panel): | ||||
| bl_label = "Turbulence" | bl_label = "Turbulence" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| tex = context.texture | tex = context.texture | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return tex and (tex.type == 'POINT_DENSITY' and (engine in cls.COMPAT_ENGINES)) | return tex and (tex.type == 'POINT_DENSITY' and (engine in cls.COMPAT_ENGINES)) | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| pd = context.texture.point_density | pd = context.texture.point_density | ||||
| self.layout.prop(pd, "use_turbulence", text="") | self.layout.prop(pd, "use_turbulence", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | class TEXTURE_PT_mapping(TextureSlotPanel, Panel): | ||||
| 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): | ||||
| return False | return False | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return (engine in cls.COMPAT_ENGINES) | return (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| idblock = context_tex_datablock(context) | idblock = context_tex_datablock(context) | ||||
| tex = context.texture_slot | tex = context.texture_slot | ||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | class TEXTURE_PT_influence(TextureSlotPanel, Panel): | ||||
| 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): | ||||
| return False | return False | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return (engine in cls.COMPAT_ENGINES) | return (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| idblock = context_tex_datablock(context) | idblock = context_tex_datablock(context) | ||||
| ▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines | |||||