Json import/export version 2

54 views
Skip to first unread message

Steffano Richi

unread,
Jan 22, 2023, 3:07:11 PM1/22/23
to ngSkinTools user list
Hello there, I am new using the ngSkinTools v2. I have a script that allowed me to export and import ngSkinLayers version 1. The thing is I used to export compressed data, because of the size which sometimes is very big. I remember that in v1 you can get a dictionary of the layers or set a dictonary to the layers, but in v2 I can't find a way to do that, just import/export json files.
I am wondering if is there  a way to achive that?

version 1:
export:

instanceLayerData = LayerData()
instanceExporter = JsonExporter()

instanceLayerData.loadFrom("mesh")
dictLayers = instanceExporter.process(instanceLayerData)

#dictLayers is a dictionary so I can compress and then export

version 2:
export:

output_file_name = os.path.join(path,file)
ngst_api.export_json("mesh",file=output_file_name)

#just export to json

Thanks in advance

PD: I've been searching and I found a command called cmds.ngst2Tools(), but only support a argument and it must be a json serialized


Reply all
Reply to author
Forward
0 new messages