is PDG Template SOP graph replication possible?

   1544   3   1
User Avatar
Member
14 posts
Joined: Nov. 2017
Offline
Trying to understand PDG use and could use some help

I want to know:
- first -if what I want is possible in PDG with relative ease (I think it should be given its simplicity…but who knows?)
- is there a better way outside PDG

Any help would be appreciated….

I want to know if it is possible to use a csv file that has file paths and file names listed as a source to populate node names and file paths in a template sop graph.


The catch is that I want to replicate said templated graph with the populated and processed graphs all within the same SOP node (see pictures).



I've attached a dummy csv file (FilePath_2Col.csv), and a hip file with a sample node and examples of how I would want the populated/processed graphs to look (see pic).


Image Not Found


Image Not Found
Edited by kahwatikid - Sept. 18, 2019 01:33:33

Attachments:
FilePath_2Col.csv (403 bytes)
PDG_FilePath_01.png (79.9 KB)
PDG_FilePath_02.png (104.9 KB)
PDG_FilePath_03.png (75.7 KB)
PDG_SOP_GRAPH_REPLICATION.hip (107.2 KB)

User Avatar
Staff
463 posts
Joined: Aug. 2019
Offline
Hi there. You can certainly process the data in the way that you describe, however it cannot create duplicate graphs like you have described in your final image. To do something like that, you would need to use python.

In your CSV Input node, set the file to “Custom File Path”, and check “Has Header Row”. Add two columns to extract. One called path with a column index of 0 and another called name with a column index of 1. If you cook this node, you should now see two attributes per work-item.

Switch back to your SOP network and change the geometry file path to `@path``@name`. These will be replaced by PDG when it evaluates the network.

Back in TOPs, you now have two options. You can either connect a ROP Fetch node with the ROP Path set to the ROP in your SOP network, or attach a ROP Geometry node pointed to your null node. The ROP Geometry node is a higher-level wrapper over the traditional ROP fetch, and can support things that do not have an explicit ROP node yet. If you choose to use the ROP Geometry node, you can delete your ROP Output node in the SOP network.

Now, if you cook the TOP network, it will pass the attributes read from the CSV file into file read node, and run the ROP geometry for each row.

Edit: Attached final hip file.
Edited by johnmather - Sept. 19, 2019 09:38:39

Attachments:
PDG_SOP_GRAPH_REPLICATION.hip (139.2 KB)

User Avatar
Member
14 posts
Joined: Nov. 2017
Offline
Hey thanks @johnmather!

Thanks for building a file for me. I tried it, and I was able to get the ROP geometry TOP node to work without a hitch.

But didn't have any luck with the SOP node setup, in-terms of getting the file path to show up in the in the SOP file node where you put the @path and @name attrs. That is the idea of what I want to achieve, but unable to get it to show up.

Is it because there are multiple lines in the csv file and the @path and @name don't really pick which line they are getting those values from (or are they?).

Without going up against my next largest hurdle of working in python/hython could my endgame result be achieved if I had already duplicated out the node graphs from the start and just have PDG fill in the blanks?

Thanks again for your help!
Edited by kahwatikid - Sept. 20, 2019 00:42:30
User Avatar
Staff
463 posts
Joined: Aug. 2019
Offline
Hi kahwatikid,

What exactly isn't working with the path substitution? For example, when I cook the ROP geometry node, I get the following error due to missing files.

Loading .hip file ~/Downloads/PDG_SOP_GRAPH_REPLICATION.hip.
ERROR: The attempted operation failed.
Error: Cook error in input: /obj/geo1/null1
Error: Invalid source /obj/geo1/file1
Error: Unable to read file “/Volumes/thisPlace/stuff01/Monster_sad_03.fbx”.

So on my machine, it is substituting the path and filename.

The way the CSV Input node is set up, is that it will extract two columns per row. Each row will be a single work item. We have defined the first column to create a “path” attribute on its associated work item, and the second column a “name” attribute.

Each work item is passed to the ROP geometry node, which executes the SOP network to the point of the NULL, for each work item that is provided to it. We can therefore access the path and name attribute from the work item from within the SOP network.

You could simplify the CSV file by joining the two columns, as in this case, it isn't necessary to have two distinct columns.

Also, FBX is a bit of an odd beast inside Houdini. Could you try using another geometry type such as obj or bgeo and see if that works?
  • Quick Links