Toggle Color Visualize for Wrangler Color

   6527   10   1
User Avatar
Member
767 posts
Joined: April 2014
Offline
I added color to a primitive wrangler as a visualizer so I can change the color of @Cd to any color using a picker. The visualizer is not overriding @Cd in the Wrangler and I don't have access to a color picker so I can make changes to the VEX code and @Cd would be overwritten by the visualizer; unless I toggle off the color visualizer ? Unless I'm mis-understanding the visualizer.
Edited by _Christopher_ - Dec. 4, 2016 23:09:29
【T】【C】【S】
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Du you have an example file?

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
767 posts
Joined: April 2014
Offline
Scene file attached.

Attachments:
Visual_Attribute.hipnc (1.8 MB)

【T】【C】【S】
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
If you set your Visualisers “Color Type” to “Constant” you can set the color with a picker.

If you want to have a color picker in your wrangler:
- Make a vector field like this: @Cd = chv(“Color”) and turn it into a spare parameter;
- Choose “Edit Parameter Interface” from the menu on the little cog wheel.
- Select you “Color” parameter and change it's type to “Color”

Not entirely sure if this is a solution to what you are asking htough

-b

Attachments:
houdini_2016-12-05_19-07-46.png (118.6 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
767 posts
Joined: April 2014
Offline
bonsak
If you set your Visualisers “Color Type” to “Constant” you can set the color with a picker.

Why doesn't the visualizer reflect what primitives are being effected when changing the gradient ramp (@facing attribute) ?
【T】【C】【S】
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
You need to set the Visualizers class to “Primitive”?
Quite hard to tell from the file as the visualizer next to “primitivewrangle1” doesn't contain any active visualizers.

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
767 posts
Joined: April 2014
Offline
bonsak
You need to set the Visualizers class to “Primitive”?

Yes I set it to Primitive.
There is no visualizer node attached to the PrimitiveWrangler1 node but it's visible within the visualizer widget in the main UI; does it matter ?
【T】【C】【S】
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Ok. I see. The UI Visualizer seems to be working as expected.
- In the primitivewrangle1 the facing attribute is set to 0 or 1.
- Then Cd is set to “facing” attribute.
- Then the Visualizer in the UI is showing Cd as it's being passed in.
- The ramp on the wrangle is not doing anything as it is not referenced in the code.

On the UI Visualizer “Color 1” change the “Color Type” to “Ramped Attribute”, then you will see that it's overriding the Cd attribute. But because the “Color 1” Visualizer is not set up as a “Scene” Visualizer, it will only be working when the “primitivewrangle1” has it's display flag set.

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
767 posts
Joined: April 2014
Offline
When you say the Visualizer is not setup as a Scene Visualizer do you mean that currently it's a local Visualizer for the object ? And how can make it a scene visualizer ?

vector target = point(@OpInput2, "P", 0);
vector aim = normalize(@target - @P);
v@am = normalize(target - @P);
@facing = ceil((dot(@N, aim)));
@Cd = @facing;
float clramp = chramp("label",@facing);

The ramp should effect @facing but it's not ?
Edited by _Christopher_ - Dec. 6, 2016 09:52:50
【T】【C】【S】
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
The code in the “primitivewrangle1” looks like this in the file you uploaded:
vector target = point(@OpInput2, "P", 0);
vector aim = normalize(@target - @P);
v@am = normalize(target - @P);
@facing = ceil((dot(@N, aim)));
@Cd = @facing;
//f@polychge(@facing);

I modified your code and created a new spare parameter on the “primitivewrangle1”:
vector target = point(@OpInput2, "P", 0);
vector aim = normalize(@target - @P);
v@am = normalize(target - @P);
@facing = ceil((dot(@N, aim)));
float clramp = chramp("Facing", @facing);
@Cd = set(clramp, 0, 0);

That seems to work.

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
767 posts
Joined: April 2014
Offline
There is one thing I can't seem to get and that is precision. In either case when adjusting the ramp it selects primitives that I don't want selected all due to the dot product.

I don't want to eliminate the dot product, I want to have more precision on what primitives are being selected by the dot product.
【T】【C】【S】
  • Quick Links