Jump to content

Sign in to follow this  
prowl

Preferences > units > unit Display On a button?

Recommended Posts

Anyone know of a way to Quickly swap between the Unit display without having to go into Preferences and dig down every Time?

Preferences > units > unit Display 


Can I stick some script code on a button?  Basically I'd like MM, CM, M, KM as buttons... 


I swap a lot between them from file to file. 

Share this post


Link to post

You can simply use scripts like this:
 

import c4d
from c4d import gui

def main():
    wc = c4d.GetWorldContainer()
    wc[c4d.WPREF_UNITS_BASIC] = c4d.DOCUMENT_UNIT_M
    # use units:
    # DOCUMENT_UNIT_UNDEF - Undefined.
    # DOCUMENT_UNIT_KM - Kilometer.
    # DOCUMENT_UNIT_M - Meter.
    # DOCUMENT_UNIT_CM - Centimeter.
    # DOCUMENT_UNIT_MM - Millimeter.
    # DOCUMENT_UNIT_MICRO - Micrometer.
    # DOCUMENT_UNIT_MILE - Mile.
    # DOCUMENT_UNIT_YARD - Yard.
    # DOCUMENT_UNIT_FOOT - Foot.
    # DOCUMENT_UNIT_INCH - Inch.
    c4d.SetWorldContainer(wc)
    c4d.EventAdd()

if __name__=='__main__':
    main()

Change the unit accordingly and put a copy of the script on any button you like.

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...