Selecting Splines by Display Colour

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  6 Days Ago
Selecting Splines by Display Colour

Hi all,

I imported an illustrator file using CV-Artsmart and I got around 7500 splines with the Use Colour option activated in the Basic tab and a Display Colour assigned to each one.

How can I tell Cinema to select splines that share the same Display colour?

Since there are so many splines I need to find an automatic way of doing this.

Thanks in advance!
  6 Days Ago

import c4d

def iterateHierarchy(obj, doc, colorToMatch):
† † while obj:
† † † † if obj[c4d.ID_BASEOBJECT_COLOR] == colorToMatch and isinstance(obj, c4d.SplineObject):
† † † † † † † † doc.SetActiveObject(obj, c4d.SELECTION_ADD)
† † † † iterateHierarchy(obj.GetDown(), doc, colorToMatch)
† † † † obj = obj.GetNext()
def main():
† † obj = op
† † if not obj: return
† ††
† † color = obj[c4d.ID_BASEOBJECT_COLOR]
† ††
† † iterateHierarchy(doc.GetFirstObject(), doc, color)
† ††
† † c4d.EventAdd()
if __name__=='__main__':
† † main()

It will select all splines that have the same color than the object you currently select.
Available for job:

Last edited by gr4ph0s : 4 Days Ago at 10:00 AM.
  5 Days Ago
I'll try it right away, thank you so much!!
  5 Days Ago
It works perfect! Thanks again!!†
  4 Days Ago
This is so cool man....!!! It even works with Polygon Objects with a minor change.... Thanks.
Lex de PrieŽlle | Studio Lex

Last edited by Lex1968 : 4 Days Ago at 07:35 AM.
  4 Days Ago
Yes of course, just remove "and isinstance(obj, c4d.SplineObject)" and it will select all kind of objects.
Available for job:
  2 Days Ago
Very generous gr4ph0s, so great to see such help from the community.
reply 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 02:25 PM.

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