Align new custom sockets to Blender UI
This commit is contained in:
parent
29785172f4
commit
2630c159d8
|
@ -122,12 +122,13 @@ class ArmColorSocket(ArmCustomSocket):
|
||||||
subtype='COLOR',
|
subtype='COLOR',
|
||||||
min=0.0,
|
min=0.0,
|
||||||
max=1.0,
|
max=1.0,
|
||||||
|
default=[0.0, 0.0, 0.0, 1.0],
|
||||||
description='Input value used for unconnected socket',
|
description='Input value used for unconnected socket',
|
||||||
update=_on_update_socket
|
update=_on_update_socket
|
||||||
)
|
)
|
||||||
|
|
||||||
def draw(self, context, layout, node, text):
|
def draw(self, context, layout, node, text):
|
||||||
draw_socket_layout(self, layout)
|
draw_socket_layout_split(self, layout)
|
||||||
|
|
||||||
def draw_color(self, context, node):
|
def draw_color(self, context, node):
|
||||||
return 0.78, 0.78, 0.161, 1
|
return 0.78, 0.78, 0.161, 1
|
||||||
|
@ -254,6 +255,7 @@ class ArmVectorSocket(ArmCustomSocket):
|
||||||
default_value_raw: FloatVectorProperty(
|
default_value_raw: FloatVectorProperty(
|
||||||
name='Value',
|
name='Value',
|
||||||
size=3,
|
size=3,
|
||||||
|
precision=3,
|
||||||
description='Input value used for unconnected socket',
|
description='Input value used for unconnected socket',
|
||||||
update=_on_update_socket
|
update=_on_update_socket
|
||||||
)
|
)
|
||||||
|
@ -261,6 +263,7 @@ class ArmVectorSocket(ArmCustomSocket):
|
||||||
def draw(self, context, layout, node, text):
|
def draw(self, context, layout, node, text):
|
||||||
if not self.is_output and not self.is_linked:
|
if not self.is_output and not self.is_linked:
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
|
col.label(text=self.name + ":")
|
||||||
col.prop(self, 'default_value_raw', text='')
|
col.prop(self, 'default_value_raw', text='')
|
||||||
else:
|
else:
|
||||||
layout.label(text=self.name)
|
layout.label(text=self.name)
|
||||||
|
|
Loading…
Reference in a new issue