On 12/02/2013 at 19:43, xxxxxxxx wrote:
well,
are you sure, that you meet the conditions for correct soft selection data ? as i said before,
you have to select the the object, activate a soft selection tool and have a selection of
course.
python is just a wrapper for cpp, so it has to work.
and i managed to unpack the data into something meaningful, the bytesequence seems to be
single.
import c4d, struct
from c4d import gui
def main() :
taglist = doc.GetActiveObject().GetTags()
for tag in taglist:
if tag.GetType() == c4d.Tsoftselection:
data = tag.GetLowlevelDataAddressR()
count = 0
for i in xrange(0, len(data)-4,4) :
fdata = struct.unpack('f', data[i:i+4])
count += 1
print fdata
print count
print data.GetDataCount()
if __name__=='__main__':
main()
edit: after posting this, i realized, that you already knew this (unpacking/casting the byte
sequence). my cpp is really bad, so please excuse me
but i'll leave the code fragment
if you do not mind, so that people who might search for a python example could use it.