djpeanut Posted April 8, 2005 Share Posted April 8, 2005 Hi folks, I'm creating an OTL. I have created two parameters: an Operator Path, and an Integer. Inside the OTL, I am trying to use these values as part of expressions in an Add SOP to create a point that matches the position of a point in another SOP, which can be defined from the OTL parameters I've created. So, in the Add SOP I have the X, Y and Z co-ordinates as follows: point(ch("../../water_sop_path"),ch("../../water_sop_point"),"P",0) point(ch("../../water_sop_path"),ch("../../water_sop_point"),"P",1) point(ch("../../water_sop_path"),ch("../../water_sop_point"),"P",2) I don't get an error, but these expressions evaluate to 0, 0, and 0! Which shouldn't be happening! In the OTL params I have an absolute path (/obj/subnet1/water/facet1) and an integer (1230) which I know correspond to an existing point, because if I change the expressions to: point("/obj/subnet1/water/facet1", ch("../../water_sop_point"), "P", 0) point("/obj/subnet1/water/facet1", ch("../../water_sop_point"), "P", 1) point("/obj/subnet1/water/facet1", ch("../../water_sop_point"), "P", 2) I get the correct co-ordinates. So for some reason, the integer param gets passed correctly, but the absolute path param does not. I'm sure there is a very simple explanation, but I can't work out why it won't work! And why doesn't an error come up? Can anyone see the problem? Is using ch() the wrong way to fetch a string parameter or something? Quote Link to comment Share on other sites More sharing options...
deecue Posted April 8, 2005 Share Posted April 8, 2005 point expression is: point(sop, pt_num, attrib, index) which is basically a chain flowing down.. This is the SOP-> Here is the point numbers I want you to pull from that sop-> Here is the attribute I want you to pull from those point(s)->And this is the index of that attribute. but to me, it looks like you are trying to have it look up a sop and instead of grabbing points from that sop, you are telling it to look up a completely different sop (that i suppose has one point in it..) but in the end, it really just doesn't work like that.. Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted April 8, 2005 Share Posted April 8, 2005 Didn't look at this very closely at all, but something jumped out at me in the first few lines... and maybe it has something to do with your problem... Shouldn't that be: point(chs("../../water_sop_path"),ch("../../water_sop_point"),"P",0) <etc> ...ie: the sop path is a string, not a numerical value... (?) just a thought. Cheers! <edit> Sorry, that should actually be: `chs("../../water_sop_path")` [with back-ticks] Or maybe even: `chsop("../../water_sop_path")` ... back to my render... </edit> Quote Link to comment Share on other sites More sharing options...
djpeanut Posted April 8, 2005 Author Share Posted April 8, 2005 Well you solved it, looking very closely or not... thanks Quote Link to comment Share on other sites More sharing options...
deecue Posted April 8, 2005 Share Posted April 8, 2005 wow.. i totally missed what was going on back in your original post.. just ignore my first reply, it's all sorts of wrong.. sorry bout that.. Quote Link to comment Share on other sites More sharing options...
edward Posted April 9, 2005 Share Posted April 9, 2005 Yeah, that's an easy mistake. Also use ifs() instead of if() for string values. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.