Added a magic token to ensure only plugin data can be parsed from the clipboard
This commit is contained in:
+18
-1
@@ -1,8 +1,25 @@
|
||||
import bpy
|
||||
import json
|
||||
from copy import copy
|
||||
from os.path import abspath
|
||||
from pprint import pprint
|
||||
|
||||
import bpy
|
||||
|
||||
|
||||
format_token = "#FMT:NODE_KIT#"
|
||||
|
||||
|
||||
def dump_nkit_format(data: str) -> str:
|
||||
return format_token + json.dumps(data)
|
||||
|
||||
|
||||
def parse_nkit_format(data: str) -> str | None:
|
||||
if data.startswith(format_token):
|
||||
print(data[len(format_token):])
|
||||
return json.loads(data[len(format_token):])
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_default(prop: bpy.types.Property):
|
||||
"""Get the default value of a Blender property"""
|
||||
|
||||
Reference in New Issue
Block a user