232bird opened this issue on Sep 27, 2011 · 19 posts
232bird posted Sun, 30 October 2011 at 11:31 PM
Quote - I would suggest you not use Input(x) although it does work. If poser adds something to PoserSurface it will break, and it makes it hard to undrstand what is going on.
Good point, I'll change it to use internal names when I do the cleanup.
For the poser surface I tried
node.Input(21).setFloat(0)
before but it didn't work. I SHOULD have used
node.Input(21).SetFloat(0)
^
been getting bitten by capitalization all day, glad I noticed that.
Quote - dont understand this at all:
Print "Node is not an image map, moving to next input..."
node1 = node2
node2 = node1.InNode(0)
testIMG()
its saying make node1 = node2
then its wrongly trying to get the node connected to node1
that wont work.
I agree, I took it out for now to do more testing. What I was trying to do with that statement is:
A B C
PoserSurface(Diffuse Color)input ->non image map node -> image map node
Node A is the current focus, so find the input for that node, which is node B. Yes? Cool, exit the function and move on. No? Ok, focus on node B, and grab its input which is node C. Restart the loop and test again. The problem with doing it cut and dry like that is that I don't know how many extraneous nodes are in the path before I hit the image map, and I need a way to feed node B to the beginning of the function so it doesn't keep trying to start with node A over and over again. Probably have to use an incremented integer with a FOR loop. Or something.
For testing the node, I followed your input and rewrote it to
if node2.Type() == poser.kNodeTypeCodeIMAGEMAP:
but it still didn't work. Here is what is really confusing me on that whole part part. The line
print node2.Type()
returns image_map. So if I use
if node2.Type() == "image_map":
Python returns
image_map
node is an image map
fourteen times, the the attribute error
File "V:Pythonmats.py", line 40, in ?
testIMG()
File "V:Pythonmats.py", line 24, in testIMG
print node2.Type()
AttributeError: 'NoneType' object has no attribute 'Type'
But if I use
if node2.Type() == poser.kNodeTypeCodeIMAGEMAP:
I still get
image_map
node is an image map
returned fourteen times, then I get the same attribute error. It seems like Python is reassigning node2, even after I took out all that funky node1 = node2 stuff. Almost forgot, I checked the typecode with the Poser Python Methods manual as well as Phillc's book, and they both used the same code, so no luck there.