Искандер Зиганшин
Denerog
About Me
EXPERTISE
Freelancer
Connect
LOCATION
Not Specified
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
Using vector4 like {vector3.x, vector3.y , vector3.z ,float} Dec. 1, 2020, 8:31 a.m.
Hello, I don't understand what is wrong. It doesn't work for me. Can it work? There is a part of huge code. I need to make all in just wrangle, because solver need to reset simulation. So I have points on some prims from lowpoly model
Prims and points have some order, which is different from the point number, so the order of wrangle by point does not suit me. I created wrangle (by detail) and used loops for make order.
There is new problem. Houdini doesn't change attribute and read the changing, so I used vector4 (x,y,z = x,y,z of Position) and w of vector4 is point number. I removed almost all the code, leaving only that does not work
//PART 1: (check the queue number of the point, and in the order
of the queue add vector4 to the array):
for (int pts_order = 0; pts_order<@numpt; pts_order ++) {
for (int j=0; j<@numpt; j++){
if (pts_order == point(0,“order”,j)){
vector4 pq;
pq.w = j;
vector pv = point(0,“P”,j);
pq.x = pv.x;
pq.y = pv.y;
pq.z = pv.z;
append(points, pq);
}
}
}
//PART 2 (the same cycle for primitive order
. For each primitive there is a group with its name. Each group contains points. We go through all points in turn and check for their presence in this group. first - attribute on all prims about what is the prim parent. I needn't change P of parent prim. then I make some changes in the position and rotation of the points, just to make at least something change.)
for (int prim_order=0; prim_order<100; prim_order++) {
for (int prim = 0; prim<@numprim; prim++) {
if ((prim(0, “order”, prim) == prim_order) && (prim != prim(0,“first”,prim))){
string grname = concat(“g_”, itoa(prim));
int ptsingr = expandpointgroup(0,grname);
foreach (vector4 pt; points) {
foreach (int ptingr; ptsingr){
if (pt.w == ptingr) {
//created a vector (Pv) from the first three values of the vector4 (pt)
vector Pv;
Pv.x = pt.x;
Pv.y = pt.y;
Pv.z = pt.z;
Pv = qrotate(quaternion(1, {0,1,0}), Pv);
Pv = Pv+1;
//reassembling vector 4 , pt.w without any changes
pt.x = Pv.x;
pt.y = Pv.y;
pt.z = Pv.z;
}
}
}
}
}
}
//PART 3 (assign value of vector4 to position)
foreach (vector4 pt; points) {
vector PV;
PV.x = pt.x;
PV.y = pt.y;
PV.z = pt.z;
setpointattrib(0,“P”,pt.w,PV,“set”);
}
I cannot use the solver as I need to quickly switch parts of the lowpoly model. And the solver requires resimulation every time I change a part of my model. Something with vector4 does not work. I checked for loops, if i just change position without using array with vector4 then everything works.
Prims and points have some order, which is different from the point number, so the order of wrangle by point does not suit me. I created wrangle (by detail) and used loops for make order.
There is new problem. Houdini doesn't change attribute and read the changing, so I used vector4 (x,y,z = x,y,z of Position) and w of vector4 is point number. I removed almost all the code, leaving only that does not work
//PART 1: (check the queue number of the point, and in the order
of the queue add vector4 to the array):
for (int pts_order = 0; pts_order<@numpt; pts_order ++) {
for (int j=0; j<@numpt; j++){
if (pts_order == point(0,“order”,j)){
vector4 pq;
pq.w = j;
vector pv = point(0,“P”,j);
pq.x = pv.x;
pq.y = pv.y;
pq.z = pv.z;
append(points, pq);
}
}
}
//PART 2 (the same cycle for primitive order
. For each primitive there is a group with its name. Each group contains points. We go through all points in turn and check for their presence in this group. first - attribute on all prims about what is the prim parent. I needn't change P of parent prim. then I make some changes in the position and rotation of the points, just to make at least something change.)
for (int prim_order=0; prim_order<100; prim_order++) {
for (int prim = 0; prim<@numprim; prim++) {
if ((prim(0, “order”, prim) == prim_order) && (prim != prim(0,“first”,prim))){
string grname = concat(“g_”, itoa(prim));
int ptsingr = expandpointgroup(0,grname);
foreach (vector4 pt; points) {
foreach (int ptingr; ptsingr){
if (pt.w == ptingr) {
//created a vector (Pv) from the first three values of the vector4 (pt)
vector Pv;
Pv.x = pt.x;
Pv.y = pt.y;
Pv.z = pt.z;
Pv = qrotate(quaternion(1, {0,1,0}), Pv);
Pv = Pv+1;
//reassembling vector 4 , pt.w without any changes
pt.x = Pv.x;
pt.y = Pv.y;
pt.z = Pv.z;
}
}
}
}
}
}
//PART 3 (assign value of vector4 to position)
foreach (vector4 pt; points) {
vector PV;
PV.x = pt.x;
PV.y = pt.y;
PV.z = pt.z;
setpointattrib(0,“P”,pt.w,PV,“set”);
}
I cannot use the solver as I need to quickly switch parts of the lowpoly model. And the solver requires resimulation every time I change a part of my model. Something with vector4 does not work. I checked for loops, if i just change position without using array with vector4 then everything works.
How to copy point attribute to channel (box position) June 2, 2020, 11:05 a.m.
Thank you so much! It really works
How to copy point attribute to channel (box position) May 31, 2020, 5:39 a.m.
I apologize in advance for my English. I have a flying points in one geo. I want to put the camera on one of them. I used “point”, but it doesn't work. I started with box. I used them separately. Combined in vex only to show.
There is a point, attributes too.
I used “opinputpath” to check the correctness of the path
Maybe I don’t notice something elementary?
There is a point, attributes too.
I used “opinputpath” to check the correctness of the path
Maybe I don’t notice something elementary?