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 Tools Display Modes
  10 October 2009
Python - Extracting Curves from a curve List


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))
	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

My Website

Last edited by RumorHazard : 10 October 2009 at 01:19 PM.
  10 October 2009
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
Society of Digital Artists

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

All times are GMT. The time now is 06:11 AM.

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