Jump to content

Primuv() Vex Function


Guest xionmark

Recommended Posts

Guest xionmark

Hi,

I'm trying to use the primuv() function but am getting an error that I do not understand:

Here's the function prototype:

float primuv (string SOP, float prim_num, string attrib_name, float attrib_index, float u, float v)

Here's a code fragment using the example from the VEX help page:

pop myPOP_Color ()
{
float grn;

grn = primuv("/obj/geo1/tube1", 0, "Cd", 1, 0.7, 0.3);

}

When compiled I get the following error:

> vcc myPOP_Color.vfl
"myPOP_Color.vfl" line 7 ERROR (1041) A value type of "void" cannot be assigned
grn = primuv("/obj/geo1/tube1", 0, "Cd", 1, 0.7, 0.3);

                                                      ^
WARNING (2007) Variable "grn" was declared but never used
REMARK (3002) There is 1 unused variable
REMARK (3003) 1 error and 0 warnings encountered
REMARK (3007) No output is generated due to errors in the source code

Is vcc really complaining about trying to assign to a var of type void? Because it shouldn't be trying to assign a value to any parameter of the function call. The error message is confusing me ...

--Mark

P.S. Here's the VEX help page for primuv():

float primuv (string SOP, float prim_num, string attrib_name, float attrib_index, float u, float v)

Evaluates the specified attribute at a parametric (u,v) position on

the primitive. u and v are unit values, defined in the [0,1]

interval. When given the "P" or "Pw" attribute, the x, y, or z

image of the (u,v) domain point will be returned. If the primitive

is a face type or a circle, v is ignored.

NOTE: if the primitive is a polygon or a mesh, u and v are defined

in terms of the number of vertices, or rows or columns

respectively. Currently, only the positional attribute of quadric

primitives can be evaluated.

For example: primuv("/obj/geo1/tube1", 0, "Cd", 1, 0.7, 0.3) Will

evaluate the Green component of the diffuse color attribute at a

location on primitive 0 given by the parametric coordinates

(0.7,0.3).

Link to comment
Share on other sites

Guest xionmark
I'm a bit confused, primuv isn't a vex function AFAIK. Its a standard houdini expression. The closest thing in vex is prim_attribute. Where is the vex help page that you got this from?

17905[/snapback]

Yep, you're right! I'm wondering why vcc didn't say something like "unknown function"?

I'll try to use the prim_attribute call 'cause I'd like to do this in VEX, I think it'll do the same as the primuv expression.

Thanks!

--Mark

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...