Jump to content

VEX pcopen error


magneto

Recommended Posts

Hi,

 

I made a simple shader that uses pcopen VOP, but when rendering I get this error:

VEX error - pcopen() requires a  constant argument for the 'preload' keyword argument
 

It's not very descriptive but I assume this is a bug in H14? Any idea how to fix it as I don't use the preload argument? I couldn't find any info in the forums.

 

 

Thanks :)

Edited by magneto
Link to comment
Share on other sites

Hi,

 

I made a simple shader that uses pcopen VOP, but when rendering I get this error:

VEX error - pcopen() requires a  constant argument for the 'preload' keyword argument

  :)

 

The pcopen() function in VEX has a variadic argument "preload" which tells the run-time engine to preload the point cloud file.  The argument to the "preload" keyword must be a constant value (i.e. not an expression).  For example, this is good:

int pc = pcopen(geo, "P", pos, radius, 1000, "preload", 1);

While this would generate the warning (the argument to "preload" is not a constant value, it's the result of an expression).

int pc = pcopen(geo, "P", pos, radius, 1000, "preload", npoints(geo) > 100);
Link to comment
Share on other sites

Hey Magneto,

 

I have a solution for you, it's more like a work around, but I haven't found any better way of having it to work. I basically created a snippet inside of my shop node which is doing the point cloud lookup. Here's a file so you can see how it works. You will need to cache the point cloud before rendering, tell me if there's anything unclear. It should do the job until sidefx fix the bug.

 

Cheers!

pcopenSnippet.hip

  • Like 1
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...