Setting Color of Individual Yarn

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
krouf@purdue.edu
Posts: 2
Joined: Mon Apr 07, 2014 12:50 am

Setting Color of Individual Yarn

Post by krouf@purdue.edu »

Dear TexGen Members,

I am trying to create a layered textile using the latest TexGen model. In my model, I want to assign different colors to yarns according to a pattern. Can you please tell me how could I control color of individual yarn in TexGen?

Regards,
Khizar
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Setting Color of Individual Yarn

Post by louisepb »

Hi Zhizar,

TexGen isn't designed to be able to be able to design colour patterns for weaves. You can change the colours in the renderer but this will only take effect until a change takes place which requires the weave to be rerendered, eg if you select one of the yarns. For example the code below will set yarn 0 to grey.

Code: Select all

rw = GetRenderWindow()
rw.SetYarnColour(0, COLOR(128,128,128))  # First parameter is yarn index
Sorry that's probably not exactly what you want to do but it's the best that can be done with the current version of the software.
Best wishes,
Louise
Post Reply