forked from bartvdbraak/blender
UI scripts:
* Fix AAO showing Distance property even though it is not supported. * Fix texture buttons not displaying texture stack from the node material. * Small visual tweak to particle mode options.
This commit is contained in:
parent
dfbe2f9974
commit
9bf20b5ec0
@ -1,6 +1,16 @@
|
||||
|
||||
import bpy
|
||||
|
||||
def active_node_mat(mat):
|
||||
if mat:
|
||||
mat_node = mat.active_node_material
|
||||
if mat_node:
|
||||
return mat_node
|
||||
else:
|
||||
return mat
|
||||
|
||||
return None
|
||||
|
||||
class TextureButtonsPanel(bpy.types.Panel):
|
||||
__space_type__ = 'PROPERTIES'
|
||||
__region_type__ = 'WINDOW'
|
||||
@ -18,7 +28,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel):
|
||||
|
||||
tex = context.texture
|
||||
slot = context.texture_slot
|
||||
ma = context.material
|
||||
ma = active_node_mat(context.material)
|
||||
la = context.lamp
|
||||
wo = context.world
|
||||
br = context.brush
|
||||
@ -45,7 +55,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
|
||||
|
||||
tex = context.texture
|
||||
|
||||
id = context.material
|
||||
id = active_node_mat(context.material)
|
||||
if not id: id = context.lamp
|
||||
if not id: id = context.world
|
||||
if not id: id = context.brush
|
||||
@ -129,7 +139,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ma = context.material
|
||||
ma = active_node_mat(context.material)
|
||||
la = context.lamp
|
||||
wo = context.world
|
||||
br = context.brush
|
||||
@ -202,7 +212,7 @@ class TEXTURE_PT_influence(TextureSlotPanel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ma = context.material
|
||||
ma = active_node_mat(context.material)
|
||||
la = context.lamp
|
||||
wo = context.world
|
||||
br = context.brush
|
||||
|
@ -129,7 +129,8 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Attenuation:")
|
||||
col.itemR(ao, "distance")
|
||||
if ao.gather_method == 'RAYTRACE':
|
||||
col.itemR(ao, "distance")
|
||||
col.itemR(ao, "falloff")
|
||||
sub = col.row()
|
||||
sub.active = ao.falloff
|
||||
|
@ -676,9 +676,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
|
||||
pe = context.tool_settings.particle_edit
|
||||
ob = pe.object
|
||||
|
||||
row = layout.row()
|
||||
row.itemL(text="Edit:")
|
||||
row.itemR(pe, "type", text="")
|
||||
layout.itemR(pe, "type", text="")
|
||||
|
||||
if pe.type == 'PARTICLES':
|
||||
if ob.particle_systems:
|
||||
|
Loading…
Reference in New Issue
Block a user