redpaw Posted April 5, 2007 Share Posted April 5, 2007 I have a simulation that uses a rbdGlue object to break up an object. it contains objects labeled as shard_# grouped up properly in a sop network, but now I want to make a semi generic script/control to look at the glue object given, get the number of objects inside of it, and export a separate chan file for each piece one at a time. can anybody give me a quick hint as to what command I can use, script wise, to get a list of the objects contained in a RBDFractured/glue object? I'm not really concerned with the idea of writing a loop to change the input of the dynamics CHOP each time and then write out the chan file.. I just need to be able to get even the count of how many objects are being passed in so I can populate my 'for each' loop with proper names. the only other solution is to build a separate output CHOP chain for each object separately and thats a LOT of nodes when I could do it with a simple loop script.. anybody? thanks in advance -redpaw Quote Link to comment Share on other sites More sharing options...
stevenong Posted April 5, 2007 Share Posted April 5, 2007 Hi redpaw, Try this: `argc(primgrouplist("/path/to/OP"))` Cheers! steven Quote Link to comment Share on other sites More sharing options...
redpaw Posted April 5, 2007 Author Share Posted April 5, 2007 doesent work.. is that command scripting language ? and if so might it be for a version of houdini I don't have yet? I'm stilll on 8.1.704 right now so no fun new python stuff yet for me.. any other ideas anyone? -j Quote Link to comment Share on other sites More sharing options...
edward Posted April 6, 2007 Share Posted April 6, 2007 No, that is in the expression language. However, your path must be to a SOP I think. Quote Link to comment Share on other sites More sharing options...
redpaw Posted April 6, 2007 Author Share Posted April 6, 2007 No, that is in the expression language. However, your path must be to a SOP I think. hmm yah thats not going to work on both counts.. I need this to happen in an hscript command although I guess I could point it all the way back to the SOP level thats feeding the glue object if I had to. -thanks. Quote Link to comment Share on other sites More sharing options...
edward Posted April 6, 2007 Share Posted April 6, 2007 If it's in an hscript command, then Steven gave you what you need, you use the backticks (`) to get into the expression language from hscript commands. Quote Link to comment Share on other sites More sharing options...
redpaw Posted April 9, 2007 Author Share Posted April 9, 2007 Ok, so maybe I'm missing something here.. but when I run that command in the textport all I get is an error "Unknown command: 0" I'm running this to test, on a merge node in sop `argc(primgrouplist("/obj/model/merge1"))` and into the merge node are 3 sphere prims. and if I run `primgrouplist("/obj/model/merge1")` I get Command '' not specific enough <double back ticks, not quote :-/ I am still confused. Quote Link to comment Share on other sites More sharing options...
old school Posted April 9, 2007 Share Posted April 9, 2007 In the textport you need to use echo like this: echo `argc(primgrouplist("/obj/model/merge1"))` Quote Link to comment Share on other sites More sharing options...
redpaw Posted April 9, 2007 Author Share Posted April 9, 2007 Ugh.. thanks.. why is it ALWAYS the stupidly simple stuff that I get caught up on.. I hope its not just me.. <insert whine about why there are no good (non simplified) scripting / expression tutorials / examples anywhere> seriously I would kill for ONE file that has a bunch of big complex expressions to see how other people do things.. Quote Link to comment Share on other sites More sharing options...
old school Posted April 10, 2007 Share Posted April 10, 2007 Lots of expression related stuff in the on-line houdini help. Check out this link in the hdocs: hdox://houdini/content/commands/commands_and_expressions.html The good old Expression Cookbook is still in there. Look for the link about the third of the way down. It's worth it to go to each and every link though. Quote Link to comment Share on other sites More sharing options...
redpaw Posted April 10, 2007 Author Share Posted April 10, 2007 AAAAhhh.. I can't believe I've never seen any of these pages in the hdox before..... sigh.. changed my settings to hdox window left/right instead of up/down... maybe now I won't forget all this other stuff is here.. thanks Quote Link to comment Share on other sites More sharing options...
old school Posted April 11, 2007 Share Posted April 11, 2007 If it were me, the very first link in the help would be to the expression cookbook followed closely by all the vex docs, example help files and the deeply burried scripting pages. 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.