Greets and problem practicing Wrangles

   1521   2   2
User Avatar
Member
2 posts
Joined: Aug. 2015
Offline
Hi, i'm newbie in the forum…so, first one, greetings to everyone…..

Well…i have a doubt about a simple question…i'm trying to practice with wrangles and i dont understand one thing….i create a simple box, add primitive normal with a NormalSOP with “Normals to” Primitive and then connect a PrimitiveWrangleSOP with the next code:

@Cd = { 0, 1, 0 };

if (@N.y == 1)
{
@Cd = { 1, 0, 0 };
}
else if (@N.y == -1)
{
@Cd = { 0, 0, 1 };
}


But…i can't see colors in the box…i only can see a black box…in the GeometrySpreadsheet i can see the values correctly but in the viewport all is black and i don't understand why….can anyone help me to understand?

One more thing…if box primitive type is NURBS the colors show OK..i don't know whats happen..sorry my bad english..and thanks.

Well…perhaps it was a stupid question because result that if i disable lights in the viewport or add light to the scene, colors appears in the viewport…i suppose that color attribute in primitives can't display in viewport without lights because adding colors to points works although there isn't lights in the scene…isn't?
User Avatar
Staff
4161 posts
Joined: Sept. 2007
Offline
Welcome!

The reason it's black in the viewport is because you're setting the normals to primitive normals, and those aren't enough to light the geometry. If you turnoff the lighting, you can see your colors (see the gif below)

Hope that helps!

Attachments:
screencast-2015-08-08-213758.gif (181.4 KB)

I'm o.d.d.
User Avatar
Member
2 posts
Joined: Aug. 2015
Offline
Yeah..it was a lighting issue…adding lights or disable lighting solves it…Thanks very much goldleaf….
  • Quick Links