Ryan,
Do you have an example of writing and importing envelope files?
In the context of surfacing, I do not but the process is exactly the same as anything else as it involves collecting chunks of text, parsing through it, and making decisions on what to do with that data. This is less about Lightwave scripting and more about understanding how to parse through and manipulate text in Python.
With envelope files, you will need to know what envelope you wish to apply and how to access that envelope.
Ok so with envelopes it isn't as simple as the SaveMotion and LoadMotion commands in the sdk? I actually have to parse the lws file?
NewData = []
MyList = [
"1 2 3",
"4 5 6",
"7 8 9"
]
for x in range(0, len(MyList)):
NewData.append(MyList[x].split(" "))
print NewData[0] # Gets XYZ coordinates of first entry
print NewData[0][0] # Gets X coordinate of first entry
print NewData[1] # Gets XYZ coordinates of second entry
print NewData[1][0] # Gets X coordinate of second entry
'''
OUTPUT:
['1', '2', '3']
1
['4', '5', '6']
4
'''
this command:
Surf_SaveText <path>
saves out surface data into a text file which is the only way i'm aware of that you can do this in python. You will then need to parse the data within that text file and make alterations to the flags/fields you want. It isn't quite convenient but its doable.
See my example script in this forum thread if you haven't already, it may help. https://forums.newtek.com/showthread.php/161309-How-to-edit-surfaces-in-layout-(with-example)