Jump to content

To get sequence length a FileSOP ?


Recommended Posts

Again the first thing that comes to mind is a cheap solution using just 2 things:

In the File sop you can flag "Missing Frame" as "No Geometry"

and using the expression "haspointattrib" with for example the attr "P", you can know if it has geometry loaded yes or no. And maybe do this within a solver sop?

interested what the final solution would be.

Link to comment
Share on other sites

I think arg expression can be useful in this case. If you follow a typical patter for naming the file , for example

$HIP/name_10_50 .$F.bgeo

then arg(chs("../file2/file"),1) should give you 10 and arg(chs("../file2/file"),2 ) should give you 50

Where file2 is the node you are using to read the written files. Write these expressions in inrange1 and inrange2 para of time warp sop. Refer attached image.

post-4903-0-19989300-1350463137_thumb.jp

Edited by sadhu
Link to comment
Share on other sites

Check this detailed list of global expression variables. I'm sure there is one that suites your needs:

http://www.sidefx.co...houdini12.1/expressions/_globals

EDIT: For some reason the link is interpreted wrong here, so please just copy paste it into your browser. It will work then.

I'd suggest $RFSTART and $RFEND or just $FSTART and $FEND

Hope that helps! :)

Edited by Scratch
Link to comment
Share on other sites


import os
path = "C:\\TEMP\\"
splitCharacter = "_"
list = []

for filename in os.listdir(path) :
basename, extension = filename.split('.')
prefix, value1, value2, number = basename.split('_')
list.append(number)

highestnumber = max(int(i) for i in list)
lowestnumber = min(int(i) for i in list)

return highestnumber[/CODE]

change your timewarp node from hscript to python and paste the code.

just change it to return lowestnumber for the min range.

It should work with you naming convention : prefix_value1_value2_number.bgeo

Edit: it assume there's only one sequence in your path.

Edited by ben
Link to comment
Share on other sites

Thanks ALL really good idea.

These days I am charge of game effect design for fx concept of previz.

I have been used Houdini that is my lovely tool.

In Game Effect, Houdini is powerful and fast.

According to your advice, I will try to define file naming.

When finishing, I will upload with other questions.

Talk to you continuously.

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...