kni8_2k Posted April 2, 2013 Share Posted April 2, 2013 The problem : Give the user the ability to pick a sop from an otl to use as the basis of instancing. Allow the user to also put expressions in the path I was looking through the forum at various ways to solve this problem, and what came up most was the evals(chsraw("../somenode..")) method. now perhaps my implementation was wrong, but it seemed like I could not get this expression working if it was a straight string that pointed at a sop, but it worked if my otl level path was something like : Worked : "/obj/firehydrant_"+($PT%2+1) Did Not Work : /obj/firehydrant I could get it working for either method but not both. The Solution was to create a switch node and use the following expression in it : if(opexist(chs("../regular_path/instancepath")), 1, 2) I added an empty add node to it, as a trick to keep the switch from erroring out. What the expression does is just look at the path and see if it can find the sop (is it a direct path) if it can't it assumes that the input is an expression and tries the 3rd input which evaluates the path with : evals(chsraw("../instanced_Geo")) If I am doing this wrong, please let me know. If this help then I am glad I shared it. Cheers, Ali 1 Quote Link to comment Share on other sites More sharing options...
kgoossens Posted April 3, 2013 Share Posted April 3, 2013 Hey Ali, thanks a lot for this tip. Have been struggling with this!! Could you also add this tip to http://odforce.net/wiki/doku.php?id=gems ? Would be great if it was easy to find later on. Cheers! Quote Link to comment Share on other sites More sharing options...
kni8_2k Posted April 3, 2013 Author Share Posted April 3, 2013 HAH ! glad I could finally help, I'm usually looking to you guys for help ! I'll try to get the tip on that page. cheers, 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.