albertdelfosse opened this issue on Dec 02, 2010 ยท 15 posts
albertdelfosse posted Thu, 02 December 2010 at 9:05 PM
I'm runing a python script I made, and I keep getting this damn error:
ValueError invalid X escape
I have a cable crossover weight machine figure with a weight stack on it. The script (one of 13), allows one to parent a weight on the stack, to the weight bar (part that goes up, and down), or to the machine frame.
The Python script works fine. However a window pops up, and gives me the error. The script takes in account of having more that one machine in a scene (suffix). FigureName = scene.CurrentFigure().Name() should allways be "cable machine" plus a suffix if any. Like cable machine_1, etc. If just one cable machine is in the scene then it's just "cable machine" Before running the script, one must make a cable machine figure the current figure, or the script will bomb.
How do I get of the error?
This is the script:
import string
import poser
scene = poser.Scene()
Suffix = ''
FigureName = scene.CurrentFigure().Name()
Suffix = FigureName[13:len(FigureName)]
Parent_1 = 'cable frame' + Suffix
Parent_2 = 'cable sel bar' + Suffix
ActorParent_1 = scene.Actor(Parent_1)
ActorParent_2 = scene.Actor(Parent_2)
Actor_20_lbs = scene.Actor('cable20 lbs' + Suffix)
Actor_40_lbs = scene.Actor('cable40 lbs' + Suffix)
Actor_60_lbs = scene.Actor('cable60 lbs' + Suffix)
Actor_80_lbs = scene.Actor('cable80 lbs' + Suffix)
Actor_100_lbs = scene.Actor('cable100 lbs' + Suffix)
Actor_120_lbs = scene.Actor('cable120 lbs' + Suffix)
Actor_140_lbs = scene.Actor('cable140 lbs' + Suffix)
Actor_160_lbs = scene.Actor('cable160 lbs' + Suffix)
Actor_180_lbs = scene.Actor('cable180 lbs' + Suffix)
Actor_200_lbs = scene.Actor('cable200 lbs' + Suffix)
Actor_220_lbs = scene.Actor('cable220 lbs' + Suffix)
Actor_240_lbs = scene.Actor('cable240 lbs' + Suffix)
Actor_260_lbs = scene.Actor('cable260 lbs' + Suffix)
Actor_280_lbs = scene.Actor('cable280 lbs' + Suffix)
Actor_20_lbs.SetParent(ActorParent_2,0,0)
Actor_40_lbs.SetParent(ActorParent_1,0,0)
Actor_60_lbs.SetParent(ActorParent_1,0,0)
Actor_80_lbs.SetParent(ActorParent_1,0,0)
Actor_100_lbs.SetParent(ActorParent_1,0,0)
Actor_120_lbs.SetParent(ActorParent_1,0,0)
Actor_140_lbs.SetParent(ActorParent_1,0,0)
Actor_160_lbs.SetParent(ActorParent_1,0,0)
Actor_180_lbs.SetParent(ActorParent_1,0,0)
Actor_200_lbs.SetParent(ActorParent_1,0,0)
Actor_220_lbs.SetParent(ActorParent_1,0,0)
Actor_240_lbs.SetParent(ActorParent_1,0,0)
Actor_260_lbs.SetParent(ActorParent_1,0,0)
Actor_280_lbs.SetParent(ActorParent_1,0,0)