Copying and Pasting references issue!

   1182   5   0
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hi guys,

A reference copy of a node works fine in the same network area, but it doesn't when I cut and paste it into another node.

For example, I have 3 material builders, and I would like to paste a reference copy of shaders into my other materials.

How can I fix it?



Thanks for helping.

Attachments:
Reference Copy.jpg (354.9 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
The main problem is it copies a relative path when referencing, but if I find a way to change it to an absolute path, the problem would be solved.
Masoud Saadatmand (MSDVFX)
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Any idea?
Masoud Saadatmand (MSDVFX)
User Avatar
Member
311 posts
Joined: Oct. 2016
Offline
Hi,

not aure exactly what is the case and I’ve not used references in Houdini.

However, probably you do not need absolute paths.

Try prefixing your rederence with ../ and then write the node name.

Like: ”../node” (meaning go up, then find my node)

Or ”../../network/node” (meaning go up, and up again, then dive in to find the node. )

It just depend on how your case is.
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hi SWest, but I'm looking for a way to make it automatically for all copied nodes, without manually making changes.
Masoud Saadatmand (MSDVFX)
User Avatar
Member
311 posts
Joined: Oct. 2016
Offline
I'm not sure how you are trying to accomplish this.

Since I try to to most things with Python...

This should give you an absolute path to a node.
hou.node('/obj/geo1').path()

However, to do all automatically some more code would be required.

So if the code would be placed in some node in the network, it could be something like
absolute_path_to_my_node = hou.node('./network/mynode').path()

When using relative paths this is always based on the source (who is calling the other node), meaning there has to be a starting point.

If you want to create nodes automatically it could be something like:

my_parent_node.createOutputNode(node_type_name='geo', node_name='my_geo')

Each node has different built in methods to create new nodes. This was just a simple example.

If you just want some Python that scans all your nodes and fixes them I'd go for some script where you select the source node, then run the script and it will check the parent node and then for child nodes. If it find material networks and reference nodes it can check for given parm patterns.

To do Python you first need some idea how to do it. Sometimes you can mimic the manual steps done but you just do it with code. With Houdini you first need to be able to get your inputs. This is usually hou.parm('/path/to/parm').eval(). Once you have them all you can easily change .eval() to .set(new value). Houdini is very logically made in that manner and consistent.

To find out things try dragging your network to the shelf. Then read the code generated. You will find names of nodes and parms there.

Please note, I have no idea how to copy paste things with Python.

I have no idea how far you arrived with anything of this.

It would be easier to help if there was an example file and maybe some code you tried. Even some pseudocode would help.

Cheers!
Edited by SWest - July 28, 2023 15:57:24
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
  • Quick Links