What is the python code to make multiple float property like in the mapping node? enter image description here


Use a FloatVectorProperty and set its subtype to 'XYZ' or 'TRANSLATION'.

Currently other available subtypes of that property are: 'COLOR', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'COLOR_GAMMA', 'LAYER'.

enter image description here

Ripped from: How to create a custom UI?

import bpy

from bpy.props import (FloatVectorProperty,

from bpy.types import (Panel,

# ------------------------------------------------------------------------
#    Scene Properties
# ------------------------------------------------------------------------

class MyProperties(PropertyGroup):

    my_float_vector: FloatVectorProperty(
        name = "Float Vector Value",
        default=(0.0, 0.0, 0.0), 
        min= 0.0,
        max = 0.1,
        subtype = 'XYZ'

# ------------------------------------------------------------------------
#    Panel in Object Mode
# ------------------------------------------------------------------------

class OBJECT_PT_CustomPanel(Panel):
    bl_idname = "object.custom_panel"
    bl_label = "My Panel"
    bl_space_type = "VIEW_3D"   
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"   

    def poll(self,context):
        return context.object is not None

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        mytool = scene.my_tool

        layout.prop(mytool, "my_float_vector", text="")

# ------------------------------------------------------------------------
#    Registration
# ------------------------------------------------------------------------

classes = (

def register():
    from bpy.utils import register_class
    for cls in classes:

    bpy.types.Scene.my_tool = PointerProperty(type=MyProperties)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
    del bpy.types.Scene.my_tool

if __name__ == "__main__":
  • 1
    $\begingroup$ Could argue the node prop highlighted in question is subtype 'TRANSLATION' given the length unit displayed. $\endgroup$ – batFINGER Jun 17 '19 at 9:33
  • $\begingroup$ True, Added. Thanks @batFINGER $\endgroup$ – brockmann Jun 17 '19 at 9:49

Blender built-in mathutils-Vector

class mathutils.Vector(seq)

This object gives access to Vectors in Blender.

Parameters: seq (sequence of numbers) – Components of the vector, must be a sequence of at least two


Most of the Blender code contain this Vector component for value modification.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.