Quantcast
Channel: Cineversity
Viewing all articles
Browse latest Browse all 2156

loop through each HairGuide and get its length using Python

$
0
0

I’m trying to get rid of all hair guides with zero length, and it seems to be impossible without selecting it manually.
So, I ended up with a script to get the guides, but I’m stuck without being able to get the length of each guide individually.

This is what I’ve got so far:

import c4d

def main
():  
    
hair doc.GetActiveObject()
    
guides hair.GetGuides()
    
gcount guides.GetCount()
    for 
index in xrange(0gcount):
        print 
guides[index][c4d.HAIRSTYLE_LENGTH]
        
    c4d
.EventAdd()

if 
__name__=='__main__':
    
main() 

Obviously this is just a guess:

guides[index][c4d.HAIRSTYLE_LENGTH] 

how can I achieve my goal?


Viewing all articles
Browse latest Browse all 2156

Trending Articles