pclaes Posted March 9, 2008 Share Posted March 9, 2008 Hi, I would like to know a bit more about attribute mapping and what the detail attribute varmap exactly does. I was wondering when it is used, if there are certain operators involved in the process. What the implecations are on memory useage. I have attached a file showing some of the mapping problems or workarounds that I found and I was wondering which of those methods are good, which are slow and why. The curve example is from a workflow suggested by old school. thanks for your help, I really would like to understand this mapping better. - Peter attribute_mapping_01.hip Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted March 9, 2008 Share Posted March 9, 2008 Hi,I would like to know a bit more about attribute mapping and what the detail attribute varmap exactly does. I was wondering when it is used, if there are certain operators involved in the process. What the implecations are on memory useage. I have attached a file showing some of the mapping problems or workarounds that I found and I was wondering which of those methods are good, which are slow and why. The curve example is from a workflow suggested by old school. thanks for your help, I really would like to understand this mapping better. - Peter Hi Peter, varmap detail attribute creates mapping to attribute, say if you have a temperature attribute you could create string type varmap attribute with a class detail. Something like this temperature -> TEMPERATURE Now you have access to this attribute via local variable with the name $TEMPERATURE. Don't worry about memory issues - varmap is detail so it's not hungry attribute. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted March 9, 2008 Share Posted March 9, 2008 An attribute mapping is just an way to set up a local variable so that you can use the `$` method of referring to attributes that exist on the geometry. It's just a way to setup a "shortcut" so that you don't need to use the long winded point expression. Basically anywhere you can use the point expression you can replace it with a mapped variable, but you have to define the "shortcut" mapping first. The way you do that is to create a detail attribute which is just a string that says what the geometry attribute is and what "shortcut" word is that you want to use to access it. By convention the shortcut is an UPPERCASE version of the name of the geometry attribute. A simple way to make this shortcut is to use an attributecreate sop which will always set up the shortcut by default. The point sop pre-dates this method of replacing the point expression and so you need to make this association by hand, this can be done by creating the mapping first with attributecreate and then overriding the attribute values, or afterwards by making the detail attribute varmap and specifying the assiocation manually. Have a look at the attached where I have suggested 2 other ways to do this before and after the point sop, it might make the process more obvious. attribute_mapping_si.hipnc Quote Link to comment Share on other sites More sharing options...
pclaes Posted March 9, 2008 Author Share Posted March 9, 2008 ok, thanks guys, I understand it better now, but I still have some questions. I created a grid and I added the detail attribute called "varmap" with "temperature -> TEMPERATURE" as its string value. I can see the mapping in the geometry spreadsheet in the details. Now I create another attribute called "varmap" with "test -> TEST" as its string value. I would assume that the original varmap attribute is "temperature -> TEMPERATURE" is changed to "test -> TEST". And if I check the spreadsheet this seems to be indeed the case, however if I middle mouse button on the last node both mappings are there. Is varmap a special keyword that builds up a list as you create more varmap attributes? Can I compare this varmap method to the declaration of variables in programming? Simon: Is it a (good) habbit when dealing with a lot of custom variables to declare them through varmap at the beginning? So they can be filled up and accessed later on? Or do you just tend to "declare" them as the need arises? Thank you for clarifying the relation between varmap and the point() expression. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted March 9, 2008 Share Posted March 9, 2008 (edited) ok, thanks guys, I understand it better now, but I still have some questions.I created a grid and I added the detail attribute called "varmap" with "temperature -> TEMPERATURE" as its string value. I can see the mapping in the geometry spreadsheet in the details. Now I create another attribute called "varmap" with "test -> TEST" as its string value. I would assume that the original varmap attribute is "temperature -> TEMPERATURE" is changed to "test -> TEST". And if I check the spreadsheet this seems to be indeed the case, however if I middle mouse button on the last node both mappings are there. Is varmap a special keyword that builds up a list as you create more varmap attributes? Can I compare this varmap method to the declaration of variables in programming? Simon: Is it a (good) habbit when dealing with a lot of custom variables to declare them through varmap at the beginning? So they can be filled up and accessed later on? Or do you just tend to "declare" them as the need arises? Thank you for clarifying the relation between varmap and the point() expression. This is just one of lots weird things in Houdini. Probably edward could explain this behaviour in details. Question about mappings is much more simple: use only necessary things. If this attribute is not in use just kill it. Same for mappings and everything else. Keep your scene clean and simple. Edited March 9, 2008 by hoknamahn Quote Link to comment Share on other sites More sharing options...
Scratch Posted August 31, 2012 Share Posted August 31, 2012 (edited) hey folks, I'm having a problem related to that topic. I want to map two variables, and did the following: attribute create varmap test -> TEST attribute create varmap test2 -> TEST2 now as expected, the second node has overwritten the first mapping. How do I have to do it in order to make both mappings work? I hope I explained it somehow clear. Any help here would be very cool! Thx in advance folks! Edited August 31, 2012 by Scratch Quote Link to comment Share on other sites More sharing options...
bird Posted September 23, 2012 Share Posted September 23, 2012 hey folks, I'm having a problem related to that topic. I want to map two variables, and did the following: attribute create varmap test -> TEST attribute create varmap test2 -> TEST2 now as expected, the second node has overwritten the first mapping. How do I have to do it in order to make both mappings work? I hope I explained it somehow clear. Any help here would be very cool! Thx in advance folks! I think it should work properly without having to do anything else. You can use both variables, $TEST and $TEST2, in other nodes, like a GROUP SOP, when you use expressions. But still, I don't know why the varmap detail attribute shows only one of them. Anybody knows? Quote Link to comment Share on other sites More sharing options...
edward Posted September 23, 2012 Share Posted September 23, 2012 The geometry spreadsheet only shows one of the strings listed in string attribute, a quirk due to the use "index attributes". If you middle-click on the SOP, it'll list all the mappings. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.