Problem with "Copy and Transform" SOP in H16

   4174   8   2
User Avatar
Member
90 posts
Joined: May 2016
Offline
Hello,

Whenever I enter the $CEX expression to compute the centroid of my object I get this error:

“Unable to evaluate expression (Undefined variable (/obj/geo1/copy1/px)).”

I attached a screenshot of the error

Attachments:
049.PNG (728.1 KB)

User Avatar
Member
8555 posts
Joined: July 2007
Offline
you can't do that in Copy and Transform
use Copy Stamp if you want to use local variables or stamping, that stuff is probably going away eventually, as is less efficient and not compilable
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
1743 posts
Joined: March 2012
Offline
The centroid expression function [sidefx.com] should work, and “0” should work to refer to the input node, e.g.

centroid("0",D_X)
Edited by neil_math_comp - March 9, 2017 11:35:48
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Staff
4164 posts
Joined: Sept. 2007
Offline
ndickson
The centroid expression function [sidefx.com] should work, and “0” should work to refer to the input node, e.g.

centroid("0",D_X)

Oh nice, I never knew you could use “0”! Thanks!
I'm o.d.d.
User Avatar
Staff
6205 posts
Joined: July 2005
Offline
Because our expression language doesn't care about strings versus integers, you can also use

centroid(0, D_X)
User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
Useful tips.
Thanks guys.
But I think copy stamp is slower than H 15.5 or at least on my machine.
For example I have a ground and I want to put some packed trees on them, unfortunately Houdini immediately freezes even with low number of points!
Hope this fixes in future releases.
Edited by Nima - March 10, 2017 16:48:45
User Avatar
Member
419 posts
Joined: Feb. 2012
Offline
copy stamp will be slow depending how many instances you have, instead you should just use an @ wrangle, also make sure to pack your geo before copying.
Edited by sepu - March 9, 2017 18:20:07
User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
Yes seems I have to use wrangle or VOP nods instead of copy stamping for now.
Thanks.
Edited by Nima - March 9, 2017 18:32:35
User Avatar
Staff
6205 posts
Joined: July 2005
Offline
If it has gotten slower from 15.5, please submit the 15.5 .hip file that became slow as a bug so we can investigate.
  • Quick Links