Solaris pattern matching

   1808   9   4
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
Hi,

trying to get pattern matching to work in Solaris, I got stuck a bit. This is one of the accepted patterns according to the documentation:


It does work as advertised, but seems to have some serious limitations.
For example, it seems to be limited to single digit numbers, for example, you can't select primitives containing numbers 11, 12, 13. (when I write , I always get the selection containing items 1, 2 and 3)

Also, I haven't worked out a way to do a range, for example 8-13. Is this kind of pattern possible?

PS: I'm using the Collection node to test this.

Thanks.
Cheers,
Ivan
Edited by ivanmalek - April 3, 2023 10:17:18

Attachments:
Screenshot 2023-04-03 160844.jpg (17.7 KB)

User Avatar
Member
357 posts
Joined: Nov. 2015
Online
Here is a file with a few solutions. Hope it helps. Also, the prims are just empty xforms with no visible gprim, so you have to see in the scene graph details that the materials are binding.
Edited by traileverse - April 3, 2023 13:27:02

Attachments:
solaris_prim_pattern_match.hiplc (87.1 KB)

hou.f*ckatdskmaya().forever()
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
Hi, thanks for the examples, they're really cool! A bit more difficult and limited than what I'd hoped, but I definitely learned something new.

Cheers,
Ivan
User Avatar
Member
357 posts
Joined: Nov. 2015
Online
ivanmalek
Hi, thanks for the examples, they're really cool! A bit more difficult and limited than what I'd hoped, but I definitely learned something new.

Cheers,
Ivan

awesome, what limitations are you having?
hou.f*ckatdskmaya().forever()
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
well... they're gone now... I found the square brackets way to be a bit lacking at first, but after I realized, that the inside of the brackets represents a character in a specific index of a string and not a number, that can be more digits, it is starting to make sense finally.
My second trouble was with the VEX version, since unlike the AssignMaterial node, the Collection node doesn't seem to support VEX. After realizing, that the Collections node is actually just a primitive and can be edited using a Wrangle node, I can now edit Collection using VEX in the Wrangle node.
So pretty much problem solved.
Thanks for your patience with me... takes a while to get into the whole USD thing.

Cheers,
Ivan
User Avatar
Member
357 posts
Joined: Nov. 2015
Online
ivanmalek
well... they're gone now... I found the square brackets way to be a bit lacking at first, but after I realized, that the inside of the brackets represents a character in a specific index of a string and not a number, that can be more digits, it is starting to make sense finally.
My second trouble was with the VEX version, since unlike the AssignMaterial node, the Collection node doesn't seem to support VEX. After realizing, that the Collections node is actually just a primitive and can be edited using a Wrangle node, I can now edit Collection using VEX in the Wrangle node.
So pretty much problem solved.
Thanks for your patience with me... takes a while to get into the whole USD thing.

Cheers,
Ivan

Great yeah man we have to help each other learn this stuff, it's a bit complex but as we start to use it more why understand that the complexity is necessary, because of what USD allows us to do. To be honest, I'd have taken anything over having to use the object context for lighting and rendering lol.
hou.f*ckatdskmaya().forever()
User Avatar
Member
8591 posts
Joined: July 2007
Online
ivanmalek
well... they're gone now... I found the square brackets way to be a bit lacking at first, but after I realized, that the inside of the brackets represents a character in a specific index of a string and not a number, that can be more digits, it is starting to make sense finally.
does the fact that it makes sense help you figure out how to specify a range as a pattern?
To me it also makes sense that every []represents possible characters for a single character
however over the years I haven't been able to figure out how to use it for arbitrary range like 09-20
I must admit that I've mostly tried this in Group syntax as a range for digits in group name or atribute name, but looking at Pattern Syntax it seems to have similar limitation

also looking at the file I don't see it having the range specified as a pattern and that VEX will work only if the matched prims contain all the numbers
there is of course always a possibility to parse the whole names in VEX, but that's much more code than being able to do explicit ranges in the code
Edited by tamte - April 6, 2023 23:28:57
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
tamte
ivanmalek
well... they're gone now... I found the square brackets way to be a bit lacking at first, but after I realized, that the inside of the brackets represents a character in a specific index of a string and not a number, that can be more digits, it is starting to make sense finally.
does the fact that it makes sense help you figure out how to specify a range as a pattern?
To me it also makes sense that every []represents possible characters for a single character
however over the years I haven't been able to figure out how to use it for arbitrary range like 09-20
I must admit that I've mostly tried this in Group syntax as a range for digits in group name or atribute name, but looking at Pattern Syntax it seems to have similar limitation

also looking at the file I don't see it having the range specified as a pattern and that VEX will work only if the matched prims contain all the numbers
there is of course always a possibility to parse the whole names in VEX, but that's much more code than being able to do explicit ranges in the code

Hi Tomáš,

Yeah, arbitrary ranges like those definitely look like a problem. But at least I'm not trying to find a syntax for specifying it inside the brackets anymore😁... That cost me quite some time.

You're also right about VEX only starting to make sense in few specific cases for this, at least in my type of work.

I mean, if this thread were to spark a RFE, I'm all for it.

Cheers,
Ivan
User Avatar
Member
13 posts
Joined: July 2013
Offline
Hi. I was looking for a similar solution. Can I use a random number between 1-10 for example? Is there a way to do that somehow?
I have this object where each bit has a piece attrib. I want to randomly assign a different material to each piece. Or do something like @pice > 3...

Cheers

Mario
Edited by Mário Domingos - Dec. 10, 2023 20:17:57

Attachments:
houdini_7bHzFMOdlc.png (919.2 KB)

User Avatar
Member
52 posts
Joined: May 2019
Offline
Mário Domingos
I want to randomly assign a different material to each piece

Hey Mario, possibly you're looking for a Material Variation LOP node [www.sidefx.com].

Videos


Edited by AnimGraphLab - March 29, 2024 13:21:10
3D Generalist. Transforming 2D images to 3D animations.
Socials: https://linktr.ee/AnimGraphLab [linktr.ee]
  • Quick Links