Python - Extracting Curves from a curve List

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2009   #1
Python - Extracting Curves from a curve List

Hi,

So I am trying to extract some subcurves from a curve object.

I think I have the correct code but it doesn't seem to work keeps crashing


 xsi = Application
lm = xsi.LogMessage
from win32com.client import constants as c

'''
selObj = xsi.Selection

for objs in selObj:
	oCrv = xsi.ApplyGenOp("ExtractEdgeLoopOp", "", objs, 3, c.siImmediateOperation, c.siKeepGenOpInputs )
'''
oCrv = xsi.Selection[0]

count = 1
for crvZ in oCrv.ActivePrimitive.Geometry.Curves:
	lm("Sub Curve : " + str(crvZ.Index))
	xsi.SelectObj(crvZ)
	Application.ExtractFromComponents("ExtractSubCrvOp","", "eye_"+str(count)+"_crv", "", "siPersistentOperation", "siKeepGenOpInputs", "")
	count += 1

 
 


the methods above works, but i have to pass in the object by selecting it and performing the extract function with an empty object so it retrieves the selected object, I would prefer to pass the crv directly into the extractFromComponent Function

The way it works is the user should select the curve object and it will extract all the individual curves that arn't joined to each other, so you will end up with multiple single curves, I think i may be passing in the wrong ActivePrimitive.Geometry.Curves object into the extractComponents

Thanks
__________________
My Website



Last edited by RumorHazard : 10 October 2009 at 01:19 PM.
 
Old 10 October 2009   #2
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:10 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.