Toggle Color Visualize for Wrangler Color
6527 10 1-
- _Christopher_
- 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】
-
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
-
- _Christopher_
- Member
- 767 posts
- Joined: April 2014
- Offline
-
- bonsak
- 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
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
-
- _Christopher_
- Member
- 767 posts
- Joined: April 2014
- Offline
-
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
-
- _Christopher_
- Member
- 767 posts
- Joined: April 2014
- Offline
-
- bonsak
- 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
- 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
-
- _Christopher_
- 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 ?
The ramp should effect @facing but it's not ?
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】
-
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
The code in the “primitivewrangle1” looks like this in the file you uploaded:
I modified your code and created a new spare parameter on the “primitivewrangle1”:
That seems to work.
-b
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
-
- _Christopher_
- 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.
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

