fixxorion Posted December 24, 2003 Share Posted December 24, 2003 Hi all, Here's a seemingly simple yet frustrating problem. All I want to do is, from tcl, run the following: hscript chkey -t 0 -v 0 -m 0 -a 1 -F 'ch("ty")' geo1/tx But everytime I do this, I get the following in the tx channel: ch(\"ty\") This, of course, isn't exactly what I wanted. How do I prevent tcl from including the escape characters when it runs the command? (I assume that's what's happening) Any help would be greatly appreciated! Thanks, fixxorion Quote Link to comment Share on other sites More sharing options...
fixxorion Posted December 28, 2003 Author Share Posted December 28, 2003 I don't think I explained it too well in the last post, so I included an example of what I want to do. This was made with Visual Tcl. Now, this script assumes that you have a geo object called "model" at the object level. When you press the button, I want it to put the following in the ty channel: ch("/obj/model/tx") Instead, I get the following: ch(\"/obj/model/tx\") This really has me stumped, so any help would be unbelievably appreciated!! Thanks, fixxorion test.tcl Quote Link to comment Share on other sites More sharing options...
edward Posted December 28, 2003 Share Posted December 28, 2003 Tcl might be taking out the single quotes ... Off the top of my head, try backslashing those. ie. hscript chkey -t 0 -v 0 -m 0 -a 1 -F \'ch("ty")\' geo1/tx Quote Link to comment Share on other sites More sharing options...
fixxorion Posted December 29, 2003 Author Share Posted December 29, 2003 hm....I tried it, but that doesn't work either. Strange...it does seem to be seeing the single quotes either way. Thanks for the help on this... fixxorion Quote Link to comment Share on other sites More sharing options...
Daniel Posted January 2, 2004 Share Posted January 2, 2004 Unfortunatly I've found the tcl scripting interface to be prertty problematic in houdini. Some hscript calls in tcl are fine to call as your doing, but any time you want to set a string field it can be a real pain. There are some other pitfalls where you get a {} around your strings and it seems impossible to get rid of them when sending tcl strings directly to houdini though the tcl hcript command The best way I've found is to simply dump commands like this to a temp file rather then sending the commands directly to houdini.. then at the end of your tcl script source them in and clean up the temp file. Heres's an example: ###################### #Open a temp file set tempfile "c:/temp" set fileID [open $tempfile w] #Dump cmds to it puts $fileID "opcd /obj" puts $fileID "chadd -t 0 0 geo1 tx" puts $fileID "chkey -t 0 -v 0 -m 0 -a 1 -F 'ch(\"tz\")' geo1/tx" #Close, source and cleanup temp file close $fileID hscript source $tempfile file delete $tempfile exit -daniel Quote Link to comment Share on other sites More sharing options...
fixxorion Posted January 2, 2004 Author Share Posted January 2, 2004 Daniel, Thanks so much for the response! That solves my problem! It's rather unfortunate that you can't send the commands directly, but at least there's a way around it. Cheers, fixxorion Quote Link to comment Share on other sites More sharing options...
Daniel Posted January 3, 2004 Share Posted January 3, 2004 no problem. I've brought up some of the issues with the tcl plugin to sesi a long time ago, but it didn't seem very high on thier priority list. I'm of the opinion that if it's in the package it should work well, or be removed. I don't see the reasoning behind having 1/2 working features, it only frustrates users. d Quote Link to comment Share on other sites More sharing options...
danteA Posted January 3, 2004 Share Posted January 3, 2004 Daniel, by that standard and this one particular problem, you should tell them to remove tcl/tk support altogether! 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.