Outliner refresh

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
whyzjuhit
Regular
Posts: 13
Joined: Sun Jun 16, 2019 8:37 am

Outliner refresh

Post by whyzjuhit »

Hi,

When I tried to dupicate yarn in GUI, outliner yarn number added with new textile rendered.

Python Output shows

Code: Select all

textile = GetTextile('TDweave')
newyarn = CYarn(textile.GetYarn(0))
textile.AddYarn(newyarn)
But when I tried to use the code, outliner yarn number remains the same and couldn't see new yarn added. I think the yarn is created but not shown correctly.
The complete code is below.

Code: Select all

# Script recorded by TexGen v3.12.0
from _Embedded import *
from TexGen.Core import *
from TexGen.Renderer import *
from TexGen.Export import *
from TexGen.WeavePattern import *
from TexGen.WiseTex import *
from TexGen.FlowTex import *
import math

weave = CTextileLayerToLayer(6, 4, 0, 0.8, 0.1, 0.1, 1)
weave.SetWarpRatio( 0)
weave.SetBinderRatio( 6)
weave.SetWarpYarnWidths( 0)
weave.SetYYarnWidths( 0.4)
weave.SetBinderYarnWidths( 0.08)
weave.SetupLayers( 3, 4, 1)
weave.SetGapSize( 0 )
weave.SetBinderPosition(0, 0, 0)
weave.SetBinderPosition(1, 0, 3)
weave.SetBinderPosition(2, 0, 0)
weave.SetBinderPosition(3, 0, 3)
weave.SetBinderPosition(0, 1, 0)
weave.SetBinderPosition(1, 1, 0)
weave.SetBinderPosition(2, 1, 0)
weave.SetBinderPosition(3, 1, 0)
weave.SetBinderPosition(0, 2, 0)
weave.SetBinderPosition(1, 2, 0)
weave.SetBinderPosition(2, 2, 0)
weave.SetBinderPosition(3, 2, 0)
weave.SetBinderPosition(0, 3, 0)
weave.SetBinderPosition(1, 3, 0)
weave.SetBinderPosition(2, 3, 0)
weave.SetBinderPosition(3, 3, 0)
weave.SetBinderPosition(0, 4, 0)
weave.SetBinderPosition(1, 4, 0)
weave.SetBinderPosition(2, 4, 0)
weave.SetBinderPosition(3, 4, 0)
weave.SetBinderPosition(0, 5, 0)
weave.SetBinderPosition(1, 5, 0)
weave.SetBinderPosition(2, 5, 0)
weave.SetBinderPosition(3, 5, 0)
weave.SetWarpYarnPower( 0.6)
weave.SetWeftYarnPower( 0.6)
weave.SetBinderYarnPower( 0.6)
weave.SetXYarnWidths(0, 0.08)
weave.SetXYarnHeights(0, 0.04)
weave.SetXYarnSpacings(0, 0.08)
weave.SetXYarnWidths(1, 0.08)
weave.SetXYarnHeights(1, 0.04)
weave.SetXYarnSpacings(1, 0.08)
weave.SetXYarnWidths(2, 0.08)
weave.SetXYarnHeights(2, 0.04)
weave.SetXYarnSpacings(2, 0.08)
weave.SetXYarnWidths(3, 0.08)
weave.SetXYarnHeights(3, 0.04)
weave.SetXYarnSpacings(3, 0.08)
weave.SetXYarnWidths(4, 0.08)
weave.SetXYarnHeights(4, 0.04)
weave.SetXYarnSpacings(4, 0.08)
weave.SetXYarnWidths(5, 0.08)
weave.SetXYarnHeights(5, 0.04)
weave.SetXYarnSpacings(5, 0.08)
weave.SetYYarnWidths(0, 0.4)
weave.SetYYarnHeights(0, 0.1)
weave.SetYYarnSpacings(0, 0.8)
weave.SetYYarnWidths(1, 0.4)
weave.SetYYarnHeights(1, 0.1)
weave.SetYYarnSpacings(1, 0.8)
weave.SetYYarnWidths(2, 0.4)
weave.SetYYarnHeights(2, 0.1)
weave.SetYYarnSpacings(2, 0.8)
weave.SetYYarnWidths(3, 0.4)
weave.SetYYarnHeights(3, 0.1)
weave.SetYYarnSpacings(3, 0.8)
weave.AssignDefaultDomain()
AddTextile('TDweave', weave, True)
textile = GetTextile('TDweave')
newyarn = CYarn(textile.GetYarn(0))
textile.AddYarn(newyarn)
I don't know if it is a bug.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Outliner refresh

Post by louisepb »

Hi Why,

Yes, I think you've found a bug. I don't know why the Outliner window doesn't update - I'll have to investigate.

In the meantime a bit of an unwieldy workaround is to save the textile after you've added the extra yarn. If you look in the tg3 file you'll see that yarn 12 has been added. When you reload the file the Outliner window is correct. The reason that you can't see the yarn is because you've duplicated yarn 0 in exactly the same position so it looks like only one has been rendered.

I hope that helps - I'll add the bug to my to-do list!

Best wishes,
Louise
Post Reply