Less lengthy version of opinputpath

   5937   5   1
User Avatar
Member
166 posts
Joined: March 2014
Offline
Hello,

I find myself extremely often having to type the following expression:
opinputpath(“.”, 0)

It's very frustrating to me that this is such a long expression when I need it all the time. I might be doing something wrong, but I don't think so. Is there an easier way of getting that first input on the current node?

Can SideFX not simply add a few additional methods? You would still have the original:
opinputpath(string path, int index)
{
// Doing all the magic here
}

And then two much easier ones, for example:
opin(int index)
{
opinputpath(“.”, index);
}

opin()
{
opin(0);
}
User Avatar
Member
280 posts
Joined:
Offline
sumtime you can replace it by using geoself() or just 0 for the first input in wrangle node…

v@P2=point(geoself(),“P”,@ptnum+1);
or
v@P2=point(0,“P”,@ptnum+1);
User Avatar
Member
280 posts
Joined:
Offline
if you give me a sample scene maybe i can give you a better answer…
User Avatar
Member
166 posts
Joined: March 2014
Offline
patar
v@P2=point(0,“P”,@ptnum+1);
Yes, I know, Wrangle nodes are not the problem. In fact, this is how short I would want it to be.

I don't have an example scene at hand, but right away I can think of a million examples.

I want to put the current mesh onto the ground plane
-bbox(opinputpath(“.”, 0), D_YMIN)

I have a curve and need it's length
arclen(opinputpath(“.”, 0), 0, 0, 1)

I want to query a detail attribute
detail(opinputpath(“.”, 0), “attribute”, 0)

I want to know how many points I'm working with
npoints(opinputpath(“.”, 0))

It drives me crazy, seriously :-)
User Avatar
Member
767 posts
Joined: April 2014
Offline
It helps your mind Chris

Why not write a HScript \ Python script where you can run and get prompt for specific attributes so you can do it faster
【T】【C】【S】
User Avatar
Member
280 posts
Joined:
Offline
works every time by replacing “opinputpath(“.”, 0)” with “0”

Attachments:
opinputSample.hip (135.0 KB)

  • Quick Links