PDA

View Full Version : Surface Editor Load and Save in the SDK



clintonman
10-21-2013, 09:36 PM
Does anyone know or have any suggestions for finding out how to save and load a surface onto a mesh via the SDK/Python?

LightFreeze
10-24-2013, 12:53 PM
this seems to work at copying surface libraries in Layout, maybe it will help.

LWSurfaceFuncs has a save and load lib you could use

clintonman
10-24-2013, 08:05 PM
Thanks, I think that does help. I see loadLib in the 11.6 python docs with a "!! NOT DOCUMENTED !!" note and it's also in the header file of the sdk without any mention of it in the sdk docs.

clintonman
10-24-2013, 11:35 PM
Just wanted to say thanks again. I got it to save and load surfaces.

lwsdk.LWSurfaceFuncs().copyLib(LWSurfLibID to, LWSurfLibID from) - copies first surface to first surface ignoring names, second to second etc.

lwsdk.LWSurfaceFuncs().copyLibByName(LWSurfLibID to, LWSurfLibID from) - copies by matching the surface name, if surface name does not exist in the destination it is added.

Then for saving and loading just give the full path for the file name

lwsdk.LWSurfaceFuncs().saveLib(LWSurfLibID lib, char name)

lwsdk.LWSurfaceFuncs().loadLib(char name)

clintonman
10-26-2013, 11:17 PM
It looks like I was wrong about the loading of surfaces from files. I get nothing but crashes when I try to use them. The good news is that the surface copy does work.