Lampert Milán

lampmilan

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Why do setattrib and set an attribute behave differently? March 3, 2025, 2:48 a.m.

I notice when I try to set a group or attribute via one of the set*groupor setattribfunctions, the changes won't reflect in my code.

if(@ptnum == 0){
    setpointattrib(0, 'test', 1, 100);  // The first point changes the 'test' value for the second point
}

/*
None of the statements become true after this, even if
the test attribute on the second point is supposed to be 100.
*/

if(i@test == 100){ // For the second point, we should step to this statement and print out the ptnum and the value
    string result = sprintf("%d : %d, ", @ptnum, i@test);
    printf(result);
    printf('\n');
}

if(point(0, 'test', 1) == 100){ 
    string result = sprintf("%d : %d, ", @ptnum, i@test);
    printf(result);
    printf('\n');
    
}

But when I do the check on a second wrangle after this one, the statements become true, and I get the results:
if(i@test == 100){ // For the second point we should step to this statement
    string result = sprintf("%d : %d, ", @ptnum, i@test);
    printf(result);
    printf('\n');
}

if(point(0, 'test', 1) == 100){ 
    string result = sprintf("%d : %d, ", @ptnum, i@test);
    printf(result);
    printf('\n');
    
}

1 : 100, 0 : 0, 1 : 100,
What's the difference between these two methods of setting an attribute, and is there any way to enforce a setattribfunction to affect the outcome of the wrangle node where I used it?"

The attrib() function doesn't return anything in a POP wrang Feb. 28, 2025, 10:01 a.m.

Thank you, that was the problem.
But this makes me curious, why can the setdetailattribwork without a defined input?

The attrib() function doesn't return anything in a POP wrang Feb. 28, 2025, 9:32 a.m.

In a Vellum solver, I want to read a detail attribute in a POP wrangle.
No matter what I try, neither the attribnor the detailfunction returns the correct value, it always acts as if the given attribute doesn’t exist.
On the other hand, setdetailattribworks without issue and successfully sets attributes at the detail level with the same values.

I've tried both POP and Geometry wrangles, but the result is the same.

i@is_exist; 
i@read_existence_check_attrib = getattrib(0, 'detail', 'my_detail_attrib', 0, @is_exist);
i@read_existence_check_detail = detailattrib(0, 'my_detail_attrib', 0, @is_exist);

// setattrib is working
setdetailattrib(0, 'set_test', 1000);