COP file reader problem

   1214   7   1
User Avatar
Member
96 posts
Joined: Nov. 2017
Offline
I have some serious problems with the file SOP in COPs.

I'm using an expression to read different image sequences after each other in order to combine wedges in a tableau, like nine wedges at the same time (nine file SOPs reading simultaneously different sequences which then get arranged in a pattern). So every x frames not only the frame number changes, but also the preceding term (like preview.0.00240 will become preview.9.00001).

Unfortunately H won't care about the new file name and just sticks to the former sequence, not loading any new images. Is there a way to make the file SOP actually load the file the expression actually tells it to load? Utterly frustrating to see the correct file path, while the node refuses to accept any other file sequence than the one already processed.

Unfortunately there's not even a python SOP in COPs which enables you to write your own loader. Can't think of anything else.

The "Still image" option seemed to be a possible solution, but it will load only the first image of the sequence. Is there a trick to force the file SOP into loading properly?


Cheers
Tom
User Avatar
Member
7835 posts
Joined: Sept. 2011
Online
I'm confused, there aren't any SOPs in COPs, by definition. Do you mean the file COP? I've had problems with getting the file COP to read an animated non-sequence frame sets. It seems to be hard-coded to work with frame sequences only. I don't think the sequence expression can be animated how you describe. You need to use a different file node for each sequence.
User Avatar
Member
96 posts
Joined: Nov. 2017
Offline
Yes, you are right. COP node. : ) If one spends half his life in SOPs, everything is a SOP, even in COPs. Lol!

This would be awful. The only other node I came across is the Labs DDS node which reads files. Wonder how they created it. Could some python code on a null work as a read node?
User Avatar
Member
7835 posts
Joined: Sept. 2011
Online
Tom Mangold
The only other node I came across is the Labs DDS node which reads files. Wonder how they created it. Could some python code on a null work as a read node?

it's not possible to read images into cops using python.

You could try reading the images as textures via vex.
User Avatar
Member
96 posts
Joined: Nov. 2017
Offline
Thanks for the tip! Will give it a try.
User Avatar
Member
122 posts
Joined: June 2019
Offline
There is (quite old I guess) workflow for defining python COP: https://www.sidefx.com/docs/houdini/hom/pythoncop.html [www.sidefx.com]
You just write functions in Code Tab in Type Properties. This is how DDS is actually written, you can check the Code Tab. It's just utilizing QImage DDS loader.

As imageio and PIL is packaged in houdini distribution you can write your own loader

Though I'm not sure if it works for your case, I'd suggest to check if cook function is actually fires with the path you want from the expression.

==

Another way is creating 2D volumes in SOP and then import them in COPs with SOP Import. From my experience marshalling 2D volumes to COPs is quite fast.
User Avatar
Member
96 posts
Joined: Nov. 2017
Offline
Wow! Sounds great. I checked the python part of the DDS loader yesterday, but thought there must be more under the hood. Would be great if it can be achieved without too much hassle.

Thank you!
User Avatar
Member
96 posts
Joined: Nov. 2017
Offline
O.k., tried both. Python seems to be a no go, unless there's somebody who can come up with a decent loader. Combining 9 images took 4min. Ridiculous.

Using multiple volumes and a sop import is the way to go- 5s to load all the images, arrange and save them.

Thanks for the tip and idea to go this way!

Tom
  • Quick Links