Difference between revisions of "LlGetPrimitiveParams"

From Second Life Wiki
Jump to navigation Jump to search
Line 45: Line 45:
|cat1=Prim
|cat1=Prim
|cat2=Face
|cat2=Face
|cat3
|cat3=Texture
|cat4
|cat4
}}
}}

Revision as of 20:16, 27 February 2007

Summary

Function: list llGetPrimitiveParams( list params );

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

• list params PRIM_* flags

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)
{//Returns a list that can be fed to llSetPrimitiveParams
    list output;
    integer c = [] != input;
    integer flag;
    integer side;
    while(c & 0x80000000)
    {
        if(~llListFindList([PRIM_BUMP_SHINY, PRIM_COLOR, PRIM_TEXTURE, PRIM_FULLBRIGHT, PRIM_TEXGEN], [ flag = llList2Integer(input, c++) ])) //pop the stack
        {
            if(~(side = llList2Integer(input, c++)))//pop the stack
                output = (output + flag) + (side + llGetPrimitiveParams([ flag, side ]));
            else
            {
                side = llGetNumberOfSides();
                do //we return the sides in reverse order, easier to code; runs faster.
                    output = (output + flag) + (side + llGetPrimitiveParams([ flag, --side ]));
                while(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 );