Difference between revisions of "LlGetPrimitiveParams"

From Second Life Wiki
Jump to navigation Jump to search
(Also functions & added FixMe links)
Line 10: Line 10:
|constants={{LSLC|FixMe||make nice constants table for here.}}
|constants={{LSLC|FixMe||make nice constants table for here.}}
|examples
|examples
|helpers={{LSLC|FixMe||Note to strife, get function from old wiki}}
|helpers=<pre>
list GetPrimitiveParams(list input)
{
    list output;
    integer c = -llGetListLength(input);
    integer flag;
    integer side;
    while(c<0)
    {
        flag = llList2Integer(input, c++); //pop the stack
        if(llListFindList([PRIM_BUMP_SHINY, PRIM_COLOR, PRIM_TEXTURE, PRIM_FULLBRIGHT], [flag]) + 1)
        {
            side = llList2Integer(input, c++); //pop the stack
            if(side == ALL_SIDES)
            {
                side = llGetNumberOfSides();
                while(side--) //we return the sides in reverse order, easier to code; runs faster.
                    output += [flag, side] + llGetPrimitiveParams([flag, side ]);
            }
            else
                output += [flag, side] + llGetPrimitiveParams([flag, side ]);
        }
        else
            output += [flag] + llGetPrimitiveParams([flag]);
    }
    return output;
}
//Contributed by Strife Onizuka
</pre>
|also_functions={{LSL DefineRow||[[llSetPrimitiveParams]]|Set many primitive parameters}}
|also_functions={{LSL DefineRow||[[llSetPrimitiveParams]]|Set many primitive parameters}}
|also_tests
|also_tests

Revision as of 18:21, 23 February 2007

Summary

Function: list llGetPrimitiveParams( list params );

Returns a list that is the primitive parameters specified in the params list.

• list params

Caveats

  • This function causes the script to sleep for 0.2 seconds.
All Issues ~ Search JIRA for related Bugs

Examples

Useful Snippets

list GetPrimitiveParams(list input)
{
    list output;
    integer c = -llGetListLength(input);
    integer flag;
    integer side;
    while(c<0)
    {
        flag = llList2Integer(input, c++); //pop the stack
        if(llListFindList([PRIM_BUMP_SHINY, PRIM_COLOR, PRIM_TEXTURE, PRIM_FULLBRIGHT], [flag]) + 1)
        {
            side = llList2Integer(input, c++); //pop the stack
            if(side == ALL_SIDES)
            {
                side = llGetNumberOfSides();
                while(side--) //we return the sides in reverse order, easier to code; runs faster.
                    output += [flag, side] + llGetPrimitiveParams([flag, side ]);
            }
            else
                output += [flag, side] + llGetPrimitiveParams([flag, side ]);
        }
        else
            output += [flag] + llGetPrimitiveParams([flag]);
    }
    return output;
}
//Contributed by Strife Onizuka

See Also

Functions

•  llSetPrimitiveParams Set many primitive parameters

Deep Notes

Search JIRA for related Issues

Signature

function list llGetPrimitiveParams( list params );