Skip to main content
added 147 characters in body
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244
added 367 characters in body
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244

FILE_PATH

Use for storing file paths. Adds a button to the UI property markup, that when used sets the string to the file path chosen. Option to make it a relative path.

DIR_PATH

Use for storing directory paths. Adds a button to the UI property markup, that when used sets the string to the directory path chosen.

FILE_NAME

AFAICT is for, as the name suggests storing a filename. Filenames cannot contain certain characters. It doesn't appear to in anyway auto-parse. The Paint Palettes addon uses the subtype for preset file names. The following method is used to parse out illegal / invalid chars.

def as_filename(name):  # could reuse for other presets
    for char in " !@#$%^&*(){}:\";'[]<>,.\\/?":
        name = name.replace(char, '_')
    return name.lower().strip()

BYTE_STRING

Stores the string as a utf-8 encoded byte string. Equivalent of "string".encode().

PASSWORD

Displays asterisks (*) when input is typed in the UI. Stores the string as entered.

NONE

Default. None of the above.

and the result of setting all to "xxxxxx" in the panel written to system console. Plus my explanation of what they do as a comment

FILE_PATH xxxxxx # adds a button to select file from filebrowser
DIR_PATH xxxxxx  # adds a button to select folder from filebrowser
FILE_NAME xxxxxx # not sure??
BYTE_STRING b'xxxxxx' # gives a bytecode representation of string
PASSWORD xxxxxx # hides the input as asterisks 
NONE xxxxxx  # default is just a string nothing more nothing less.

Note

The 'FILE_NAME' option AFAICT is for, as the name suggests a filename. Filenames cannot contain certain characters. It doesn't appear to in anyway auto-parse. The Paint Palettes addon uses the subtype for preset file names. The following method is used to parse out illegal / invalid chars.

def as_filename(name):  # could reuse for other presets
    for char in " !@#$%^&*(){}:\";'[]<>,.\\/?":
        name = name.replace(char, '_')
    return name.lower().strip()

and the result of setting all to "xxxxxx" in the panel written to system console. Plus my explanation of what they do as a comment

FILE_PATH xxxxxx # adds a button to select file from filebrowser
DIR_PATH xxxxxx  # adds a button to select folder from filebrowser
FILE_NAME xxxxxx # not sure??
BYTE_STRING b'xxxxxx' # gives a bytecode representation of string
PASSWORD xxxxxx # hides the input as asterisks 
NONE xxxxxx  # default is just a string nothing more nothing less.

Note

The 'FILE_NAME' option AFAICT is for, as the name suggests a filename. Filenames cannot contain certain characters. It doesn't appear to in anyway auto-parse. The Paint Palettes addon uses the subtype for preset file names. The following method is used to parse out illegal / invalid chars.

def as_filename(name):  # could reuse for other presets
    for char in " !@#$%^&*(){}:\";'[]<>,.\\/?":
        name = name.replace(char, '_')
    return name.lower().strip()

FILE_PATH

Use for storing file paths. Adds a button to the UI property markup, that when used sets the string to the file path chosen. Option to make it a relative path.

DIR_PATH

Use for storing directory paths. Adds a button to the UI property markup, that when used sets the string to the directory path chosen.

FILE_NAME

AFAICT is for, as the name suggests storing a filename. Filenames cannot contain certain characters. It doesn't appear to in anyway auto-parse. The Paint Palettes addon uses the subtype for preset file names. The following method is used to parse out illegal / invalid chars.

def as_filename(name):  # could reuse for other presets
    for char in " !@#$%^&*(){}:\";'[]<>,.\\/?":
        name = name.replace(char, '_')
    return name.lower().strip()

BYTE_STRING

Stores the string as a utf-8 encoded byte string. Equivalent of "string".encode().

PASSWORD

Displays asterisks (*) when input is typed in the UI. Stores the string as entered.

NONE

Default. None of the above.

and the result of setting all to "xxxxxx" in the panel written to system console.

FILE_PATH xxxxxx
DIR_PATH xxxxxx
FILE_NAME xxxxxx
BYTE_STRING b'xxxxxx'
PASSWORD xxxxxx
NONE xxxxxx
added 503 characters in body
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244

Note

The 'FILE_NAME' option AFAICT is for, as the name suggests a filename. Filenames cannot contain certain characters. It doesn't appear to in anyway auto-parse. The Paint Palettes addon uses the subtype for preset file names. The following method is used to parse out illegal / invalid chars.

def as_filename(name):  # could reuse for other presets
    for char in " !@#$%^&*(){}:\";'[]<>,.\\/?":
        name = name.replace(char, '_')
    return name.lower().strip()

Note

The 'FILE_NAME' option AFAICT is for, as the name suggests a filename. Filenames cannot contain certain characters. It doesn't appear to in anyway auto-parse. The Paint Palettes addon uses the subtype for preset file names. The following method is used to parse out illegal / invalid chars.

def as_filename(name):  # could reuse for other presets
    for char in " !@#$%^&*(){}:\";'[]<>,.\\/?":
        name = name.replace(char, '_')
    return name.lower().strip()
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244
Loading