mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
Ignore the index when accessing a scalar variable
This commit is contained in:
@@ -1011,10 +1011,10 @@ namespace client
|
|||||||
OptWithPos &output)
|
OptWithPos &output)
|
||||||
{
|
{
|
||||||
if (! ctx->skipping()) {
|
if (! ctx->skipping()) {
|
||||||
if (! opt.opt->is_vector())
|
|
||||||
ctx->throw_exception("Cannot index a scalar variable", opt.it_range);
|
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = 0; // Orca: fallback to first element if index < 0, this matches the behavior of BambuStudio
|
index = 0; // Orca: fallback to first element if index < 0, this matches the behavior of BambuStudio
|
||||||
|
if (!opt.opt->is_vector())
|
||||||
|
index = -1; // Orca: ignore the index if variable is scalar, this matches the behavior of BambuStudio
|
||||||
output = opt;
|
output = opt;
|
||||||
output.index = index;
|
output.index = index;
|
||||||
} else
|
} else
|
||||||
|
|||||||
Reference in New Issue
Block a user