I have a script that converts data from one type to another. The source file can have one, two or all of: position, rotation and scale data.
My script zips the 3 together after conversions have taken place for the output file.
In this case, my source file only contains position data. So the lists returned at the end are:
pData = [['-300.2', '600.5'],['150.12', '280.7'],['19.19', '286.56']]
rData = []
sData = []
translationData = list(zip(pData, rData, sData))
If I try this, it will return []
because the shortest list is []
.
If I try:
translationData = list(zip_longest(pData, rData, sData))
I get:
`[(['-300.2', '600.5'], None, None), (['150.12', '280.7'], None, None), (['19.19', '286.56'], None, None)]`
Is there any way to only zip lists that contain data, or remove the None
's from within the tuples within the list?
Thanks in advance!