Fix #104926: Object Info node doesn't give negative scale
The previous behavior was giving a completely negated scale if any of the object's original scale values was negative. Restore that behavior here. Pull Request: https://projects.blender.org/blender/blender/pulls/116989
This commit is contained in:
@@ -266,7 +266,7 @@ std::unique_ptr<ColumnValues> GeometryDataSource::get_column_values(
|
||||
if (STREQ(column_id.name, "Scale")) {
|
||||
return std::make_unique<ColumnValues>(
|
||||
column_id.name, VArray<float3>::ForFunc(domain_num, [transforms](int64_t index) {
|
||||
return math::to_scale(transforms[index]);
|
||||
return math::to_scale<true>(transforms[index]);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,10 @@ class InstanceScaleFieldInput final : public bke::InstancesFieldInput {
|
||||
GVArray get_varray_for_context(const bke::Instances &instances,
|
||||
const IndexMask & /*mask*/) const final
|
||||
{
|
||||
auto scale_fn = [&](const int i) -> float3 {
|
||||
return math::to_scale(instances.transforms()[i]);
|
||||
};
|
||||
|
||||
return VArray<float3>::ForFunc(instances.instances_num(), scale_fn);
|
||||
const Span<float4x4> transforms = instances.transforms();
|
||||
return VArray<float3>::ForFunc(instances.instances_num(), [transforms](const int i) {
|
||||
return math::to_scale<true>(transforms[i]);
|
||||
});
|
||||
}
|
||||
|
||||
uint64_t hash() const override
|
||||
|
||||
@@ -58,10 +58,10 @@ static void node_geo_exec(GeoNodeExecParams params)
|
||||
float3 location, scale;
|
||||
math::Quaternion rotation;
|
||||
if (transform_space_relative) {
|
||||
math::to_loc_rot_scale(transform, location, rotation, scale);
|
||||
math::to_loc_rot_scale<true>(transform, location, rotation, scale);
|
||||
}
|
||||
else {
|
||||
math::to_loc_rot_scale(object_matrix, location, rotation, scale);
|
||||
math::to_loc_rot_scale<true>(object_matrix, location, rotation, scale);
|
||||
}
|
||||
params.set_output("Location", location);
|
||||
params.set_output("Rotation", rotation);
|
||||
|
||||
Reference in New Issue
Block a user