VEX script crashing 16.5.268 - Mac

   1470   2   0
User Avatar
Member
21 posts
Joined: May 2017
Offline
I'm learning Houdini and was copying a VEX script from a Youtube video:

The first 4 lines to vector origin work and create the 3 controls, but when I add the rest, Houdini does nothing and seems to be frozen. If I type the code in the expression window and click Apply, it does the same thing, just hangs.

Am I doing something wrong? Or is this just a bug?

Nvidia GTX980 (driver: 346.03.15f09)
Mac Pro (Early 2009) — 4,1
2 x 2.26 GHz Quad-Core Intel Xeon
32GB RAM
macOS 10.11.6 (El Capitan)

//user controls
int sample = chi('sample');
float radius = ch('radius');
vector origin = chv('origin_position');

float TWO_PI = 3.14159 * 2;

float theta = 0;
float step_angle = TWO_PI / (float)sample;

float x, z;
vector pos;

while(theta < TWO_PI) {
	
	x = origin.x + cos(theta) * radius;
	z = origin.z + sin(theta) * radius;

	pos = set(x, origin.y, z);

	addpoint(0, pos);
	
	theta  += step_angle;
}
User Avatar
Member
2536 posts
Joined: June 2008
Offline
Are you running in Detail mode on the wrangle? If not, you are executing the loop for every point in your current geometry?

Also what is the value of sample? If it is 0 then your step_angle will never increase theta and you will end up in an infinite loop.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
21 posts
Joined: May 2017
Offline
Enivob
Are you running in Detail mode on the wrangle?

Also what is the value of sample? If it is 0 then your step_angle will never increase theta and you will end up in an infinite loop.

THAT'S what it was, thanks Enivob! Sorry, I'm still new to VEX, but it makes sense now. Thanks for your help!
  • Quick Links