Jump to content

Using attributes as parameter


Recommended Posts

Hello peeps,

I'm trying to do something relatively simple and I think this was asked before but so far I couldn't find the right answer or the right video with that info, so far. Somewhat easy question.... I have a custom point attribute created with a value @Cd from an "attribute from map" node placed up in the stream and I want to use this custom attribute to control a parameter, in this case "scale.y" of a geo copied on points. I remember watching one of Jeff Wagner's class sometime ago where he talks about attributes, attribute transfer and using attribute as parameter and on the ladder, he calls a custom attribute on a parameter by typing the custom attribute name in the parameter field, something like "@customattrib > 0.3" or something similar to this.

 

Curiously, I remember thinking that that trick was neat because he didn't use the famous point() or detail() expressions in the parameter field to call the custom attribute inside the parameter. Very efficient way to use custom attributes...That said, does anyone knows the video where he talks about this or knows that correct syntax to call the custom attribute in the parameter field without using the point or detail expressions?

Any help is greatly appreciated. 

Link to comment
Share on other sites

That doesn't work everywhere. It works in `group` type parameters or the polyextrude node (if you set it up in the UI), for example. It doesn't work in many other parameters.

For consistency sake you're better sticking with the `point(...)` syntax or the Python equivalent. That will work in virtually all cases.

Oh, yes, you might be confusing it with the new PDG stuff that lets you do `@attribute` if you set it up in TOPs. That also works in most places.

Link to comment
Share on other sites

  • 1 year later...

Hey @vtrvtr,

Thanks for the heads up. I tried using the "point(/..)" expression inside the parameter and it doesn't really do what I was expecting.

In this case i'm using a color attribute called @grad applied to the whole model to drive an inset in certain regions using the poly extrude sop (ideally adding the color attribute in "Thickness Ramp" section, inside the "Value" parameter) but with the "point()" expression I can only access attributes from 1 point.

What would be the procedure to have the inset only in white areas using the poly extrude/thickness ramp control, for instance and leave the black areas untouched?

 

Link to comment
Share on other sites

@toadstorm Thank you for sending the file. I'm looking for something that is almost like that but with a little more control.

I'm using a second model to drive the insetting by transferring colors from an object to another object. I used your file to show what i'm looking for.

Essentially, I painted the sphere black, created another object with a curve and painted it white and then transferred the colors from the object to the sphere which is working. However, I find controlling the insetting through the Ramp Thickness value much more stable than through the regular "Inset" parameter.

That said, I'm curious to know if it is possible to use the transferred color attribute in the "Value"parameter inside the Thickness Ramp section within the poly extrude sop to control the insetting.

Attached is the file.

inset_by_attribute_1.hip

Link to comment
Share on other sites

I'm not exactly sure what you're getting at with the Thickness Ramp. That's for spine profiles, and you're not using one of those. If you were extruding faces along a curve and wanted to control the extrusion thickness over that length, that's the control you'd use.

If you *are* trying to use this to drive extrusion inset along a spline, you can just draw that ramp and then enable use of a Thickness Attribute, and pass along your attribute like before.

In the file you sent me, all you need to do is set the Local Control > Inset Scale attribute to "inset".

inset_by_attribute_2.hip

Link to comment
Share on other sites

Once again, thanks for the file! So, I tend to use thickness ramp for insetting because when I'm working with more organic poly models sometimes the "Inset" ends up braking the polygons due to its area or it doesn't give enough insetting due to the "Limit Insetting" option or the "Use Common Limit" option.

I'll try to create an example where I use the color to drive insetting and yet by driving it through the "Inset" parameter becomes a little limiting due to smaller area polygons on a model that has small and larger polygon areas. When that is the case, the smaller polygons prevents the bigger polygons to get a lot of insetting. The result is usually a nice inset in small polygons but not enough inset on bigger polygons.

I was aware about turning on the inset scale control and add the attribute there but in the case that I described above it doesn't work that well. Still, thank you for explaining.

Link to comment
Share on other sites

OK, so here is the file that illustrates what I'm talking about regarding the "Inset" parameter being blocked by small polys in the model. Actually, I just discovered that by unchecking the "Use Common Limit" option in the poly extrude sop, the "Inset" works pretty much the same (aesthetically speaking) as the thickness ramp value which is what I'm looking for.

Anyways, attached is the file showing the "Inset" parameter with a value of 50 and still a minimal amount of inset created on the polys as I mentioned. That is due to the small polys in the model that are blocking the inset for the bigger polys but I guess I just found a workaround :)

inset_by_attribute_3.hip

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...