0
$\begingroup$

Is it possible to adjust the number of decimal places that are displayed for the "Dimensions" values in the transform window (N panel)? Location, Rotation, and Scale are all displayed with up to 4 decimal places but Dimensions get rounded to 1. I do some precise modeling and need to display 4 decimal places so I don't constantly have to click in the appropriate field to expose the actual resolution.

$\endgroup$

1 Answer 1

1
$\begingroup$

The simple way:

Change settings for displayed units in Scene Properties tab > Units Manual enter image description here

The pythonic way:

I am not so happy with manipulating the N panel because it´s used for a lot of different information. We may better expand the Transform panel in the Object Properties tab. The dimensions are displayed here with 4 decimal places by default and more if Unit System is set to None. Run script in Texteditor to see. enter image description here

import bpy

def register():
    
    def draw_transform_new(self, context):
        layout = self.layout
        layout.use_property_split = True
        ob = context.object
        col = layout.column()
        row = col.row(align=True)
        row.prop(ob, "location")
        row.use_property_decorate = False
        row.prop(ob, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED')

        rotation_mode = ob.rotation_mode
        if rotation_mode == 'QUATERNION':
            col = layout.column()
            row = col.row(align=True)
            row.prop(ob, "rotation_quaternion", text="Rotation")
            sub = row.column(align=True)
            sub.use_property_decorate = False
            sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
            sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
        elif rotation_mode == 'AXIS_ANGLE':
            col = layout.column()
            row = col.row(align=True)
            row.prop(ob, "rotation_axis_angle", text="Rotation")

            sub = row.column(align=True)
            sub.use_property_decorate = False
            sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
            sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
        else:
            col = layout.column()
            row = col.row(align=True)
            row.prop(ob, "rotation_euler", text="Rotation")
            row.use_property_decorate = False
            row.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
        row = layout.row(align=True)
        row.prop(ob, "rotation_mode", text="Mode")
        row.label(text="", icon='BLANK1')

        col = layout.column()
        row = col.row(align=True)
        row.prop(ob, "scale")
        row.use_property_decorate = False
        row.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED')

        col = layout.column()
        row = col.row(align=True)
        row.prop(ob, "dimensions", text="Dimension")
                
    bpy.types.OBJECT_PT_transform.draw = draw_transform_new   # replace 
                    

### use this for live edit

if __name__ == "__main__":  
    register()


### or this for autorun, if
### scriptfile 'redraw_transform_panel.py' (extension!) is in folder BlenderUser/[Version]/scripts/startup/
### filepath to BlenderUser see: print(bpy.utils.user_resource('SCRIPTS'))
### if there´s no folder 'startup' in .../scripts/ then create one
'''
__name__ == "redraw_transform_panel.py"   
register() 
'''

The script in the Texteditor must be activated every time Blender is restarted. To run automatically at startup follow the hints at the bottom.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .