Translation of a Range of Nodes?

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
NovaEGR09
Posts: 1
Joined: Tue Sep 01, 2009 6:11 pm

Translation of a Range of Nodes?

Post by NovaEGR09 »

I have a large model with a huge number of nodes in which I am trying to translate numerous large ranges of nodes at once. Rather than select all the nodes through the GUI which has proven to take forever, I'd like to be able to select the nodes, move them through code, and then re-render the window. Here is what I have accomplished thus far:

Code: Select all

firstyarn = 473
lastyarn = 501 #last yarn to be selected
firstnode = 3
lastnode = 7 #last node to be selected

for i in range(firstyarn,lastyarn+1,1):
	yarn = layerfortyquarter.GetYarn(i)
	for n in range(firstnode,lastnode+1,1):
		node = yarn.GetNode(n)
		node.Translate(XYZ(0.0,0.0625,0.0))
An error occurs in the last line of this code, which reads: "tuple object is not callable." I'm clearly missing something here, as I was under the impression the XYZ() required a tuple, and I don't know how else to translate the node other than using the translate() command and defining the translation vector in XYZ.

A couple other problems I foresee raise these questions as well:
-Do I need to be concerning myself with slave nodes in addition to/instead of nodes?
-Will I need to include code to have TexGen re-render the window with the nodes in their new locations?

As much help as could possibly be offered is very much appreciated, and thanks in advance for your time and efforts.
Post Reply