Jump to content

Getting Total From A Obj Sequence


Recommended Posts

Hi,

is there a way .. to get the value of the total number of "frames" that an obj sequence is made by?

let me explain... I'm working on my Crowd OTL .. and now I need to specify the start and end frame (which is cool anyway since the animatio loop and you can "cut" it at a certain point if you need) .. but I'd like that when you specufy the Obj sequence "char" you need to load ... the OTL founds itself how many OBJ the sequence is made of.

thanks for any advices

cheers

Link to comment
Share on other sites

You'll have to pop out to linux to get it - something like this in a numeric field:

system("ls -1 "+strreplace(chsraw("your_filename_parm"),"\$F4","*") +"| wc")

- counts (with wc) the number of files returned by "ls" which match the filename spec (with the frame specifier substitued with a wildcard)

Jason

PS. TOTALLY UNTESTED:)

Link to comment
Share on other sites

One thing to be wary of, however, is if you use this in an expression in parameter of an HDA that you might very well be hopping out to the system far more often than you want to. You can check with the Performance Monitor - your eternal friend.

One way to avoid this is to put this in "callback script" field for the file-browser (if this is how you're selecting the geo sequence) and this would opparm the end_frame parameter. You could have a "Reload" button next to it that does the same thing (as well as clearing caches, etc).

Link to comment
Share on other sites

I placed the above expression.. as a value1 of a attribute create inside my HDA just to have the total frames value

in the HDA interface... I still let the user to select "start" and "end" frame... while I fetch the "total frames" information from the attribute stated above.. and I wrote it down on top of the HDA just as an information ...

here's a screenshot of my HDA gui as it shows currently.

post-490-1153514613_thumb.jpg

Here i choose the animation clip to be loaded (assuming there's many available for this character)

the start and end frames (and offset) is still selectable by the user

post-490-1153514623_thumb.jpg

here I set the path (usually its $HIP/geo/) and I select the character to be loaded (assuming there's many different types available

then ther's the crowd_copy HDA which is still WIP also :)

Link to comment
Share on other sites

just out of curiousity .... since I'm doing all my "working and testing" on a apprentice license... and since this Crowd would be nice to .. be used one day... (next week two Master will be ordered!! :D yahooooo) .... did SESI also convert OTL from NC to commercials?

or is there a .. command for that?

Link to comment
Share on other sites

[one' date=Jul 21 2006, 01:48 PM' post='29476]

just out of curiousity .... since I'm doing all my "working and testing" on a apprentice license... and since this Crowd would be nice to .. be used one day... (next week two Master will be ordered!! :D yahooooo) .... did SESI also convert OTL from NC to commercials?

or is there a .. command for that?

Well, one way to do it is to share your OTL on the Exchange. As a thank you for sharing with the community, SESI will convert it to Master for everyone to use.

However, since you've bought a Master license I'm sure SESI will do it for you privately if you send them the OTL in an email.

Link to comment
Share on other sites

figure.... I was starting another one ... where I wanted to add different functions (choice between using CopySOP or particle instancing) ... and guess what?... i did something wrong with the naming.. dunno .. dont ask me... :( .. I lost the above HDA ... i've got an "old" releas which is 4 days old.. and lack of all those fixes I made during latest days.....

I shouldnt be doing this stuffs at 2am friday night... i should be Drinking BEER!! damn ....

anyway .. about sharing the OTL it wouldnt be a problem .. but.. as it is made, it have big restrictions on how you can use.. i mean .. since this is a test on how to make a stadium crowd procedurally... the OTL expect specific group names (which comes from XSI clusters or objects) to work.. else is almost useless...

if sharing such type of stuff as is, to learn from them for example, is ok anyway ... let me fix the big crap i just did and I'll upload it...

that said.. this crowd system is ment to be a "non AI" crowd... like a stadium crowd.. not moving yet.. just "sit" animation or such... I'm trying to make the same HDA be able to make "non random" animations like stadium waves or so .. but i'm not there yet.

Also I'm planning to give the OTL to ability to switch from use of CopySOP.. to particle instancing.. which will take me much more time...

also.. since this specific OTL is "just" to load the Character itself.. I have another OTL which is basically a CopySOP with its own new interface (the OTL itself) to let me control the "randomness" of the resulting crowd..

Is that confusing enought? :D

again.. its friday night... what the hell am I doing here?....

cheers.

p.s. I'll write Sesi next week about all my "OTLs" and scenes.. I hope they can be converted to commercial since lot of my last months testing... was done for two reasons mainly....

- get the company understand the power of Houdini and buy it.

- get myself confortable by doing the needd effects for the current productions with houdini

therefore i've got lot of stuffs I did during last months which I'd like to not have to rebuild from scratch.. but continue from where i left my job... I'll see what Sesi can do.

/me goes back to houdini fixing the big mistake..

Link to comment
Share on other sites

ok

I rebuilt my old HDA... was trying to optimize it a bit but now i'm stuck with performance results which I dont really understand.

I've got a File sop which have the above expression.. and the a DeleteSOP which removes part of te Character... in my old HDA it takes around 16ms to cook ... and the FileSOP takes around 20mx to cook.. in my new one.. times are doubled if not even much more... and the faster fileSOP even have more "if" expression inside the global fileSOP expression... using same bgeo as source..

also .. I'm using subdivideSOP and many others which are driven by HDA interface.... but i wonder if it'd make cooking time faster by driving the "bypass flag" instead of giving values... example... subdivideSOP... wouldnt be faster too "cook" if bypassed instead of giving value 0 as Subd value?

if so .. how can I do this? (opdef comes to my mind... but I didnt menaged to understand it really well and if this is the case to use it.. your help would be really appreciated)

I guess sometimes I should get out of this "let's optimize as hell" mind :D

cheers.

Link to comment
Share on other sites

also .. I'm using subdivideSOP and many others which are driven by HDA interface.... but i wonder if it'd make cooking time faster by driving the "bypass flag" instead of giving values... example... subdivideSOP... wouldnt be faster too "cook" if bypassed instead of giving value 0 as Subd value?

Use Switch SOP.

Link to comment
Share on other sites

ok.. i'm close to have a finished first version of this "crowd_char" generator...

now... here's how I planned this "crowd" system and below the help I'd need about this.

- a Crow_Char OTL which just loads a specified char* and a clip* from its library (bgeo sequences for all the clips of every chars, since in my needs they comes as it from XSI)

- a Crow_Gen OTL which is basically a CopySOP with some Stamped variables that, if enabled in the Crowd_Char OTL, can randomize stuffs like coloring, positiong, animation offset and many others.

this way .. the user is forced to use both.. to add a switch... add various Crowd_Char and do all those connections.. which arent that hard since everything else is done by the OTL itself.. but i wanted to make everything in just one OTL.

first thing comes to my mind (which i'll give a try in minutes) is enclosing this OTL inside another one.. which will have some inputs... for the Char positioning including random position based on particles.. or manual position based on lines drawn by the user.

the "problem" that I need to solve is the following.

how to make the OTL self add as many Crowd_Char as the user need and how to connect 'em to the switch that will then connected to the CopySOP for stamping.

I guess I've been confusing enought.. :):) ... I hope you did got the point.

main thing i need to know is how to run Hscript from a SOP node like adding such OTL SOP and conect it using a OTL Gui.

cheers :D

p.s. i guess I'll can post the OTL as soon as I'll finishe this step.. now the OTL itself is pretty much useless.. since as I tol above.. is based on XSI chars that I'm handling here from the animators.... with specific Cluster/Groups .. without which the OTL wont do that much except playing animation and clip for different Chars.. but i'll be pleased to share it once finished.

I'm wanting to make a Crowd OTL which can be used more generally... but I want to solve/learn all the needed things before by finishing this one. :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...