LlSetPrimitiveParams/ja

From Second Life Wiki
Jump to navigation Jump to search

要約

関数: llSetPrimitiveParams( list rules );

rulesに沿ってプリムのパラメータを設定します。

• list rules

これはとても強力で切れ味のよい関数で、それぞれのルールは 1 個以上のパラメタを受け入れ、奇癖もあります。それぞれの PRIM_* ルールには仕様が載っている専用の記事があります。
フラグ 説明
LINK_ROOT 1 リンクセットの中のルートプリムに送ります
フラグ 説明
LINK_THIS -4 スクリプトの入った自プリムに送ります

フラグ 説明 使い方
PRIM_NAME 27 プリムの名前を設定します。 PRIM_NAME, string name ]
PRIM_DESC 28 プリムの説明を設定します。 PRIM_DESC, string description ]
PRIM_TYPE 9 プリムの形状を設定します。 PRIM_TYPE, integer flag ] + flag_parameters
PRIM_SLICE 35 プリム属性のスライスを設定します。 PRIM_SLICE, vector slice ]
PRIM_PHYSICS_SHAPE_TYPE 30 プリムの物理形状タイプを設定します。 PRIM_PHYSICS_SHAPE_TYPE, integer type ]
PRIM_MATERIAL 2 プリムの素材を設定します。 PRIM_MATERIAL, integer flag ]
PRIM_PHYSICS 3 プリムの物理状態を設定します。 PRIM_PHYSICS, integer boolean ]
PRIM_TEMP_ON_REZ 4 臨時 属性を設定します。 PRIM_TEMP_ON_REZ, integer boolean ]
PRIM_PHANTOM 5 オブジェクトのファントム状態を設定します。 PRIM_PHANTOM, integer boolean ]
PRIM_POSITION 6 プリムの位置を設定します。 PRIM_POSITION, vector position ]
PRIM_POS_LOCAL 33 プリムのローカル位置を設定します。 PRIM_POS_LOCAL, vector position ]
PRIM_ROTATION 8 プリムの回転を設定します。 PRIM_ROTATION, rotation rot ]
PRIM_ROT_LOCAL 29 プリムのローカル回転を設定します。 PRIM_ROT_LOCAL, rotation rot ]
PRIM_SIZE 7 プリムの大きさを設定します。 PRIM_SIZE, vector size ]
PRIM_TEXTURE 17 プリムのテキスチャ属性を設定します。 PRIM_TEXTURE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians ]
PRIM_RENDER_MATERIAL 43 プリムのrender_materialを設定します。 Setting this param will also clear most PRIM_GLTF_* properties on the face, with the exceptions of repeats, offsets, and rotation_in_radians

Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

PRIM_RENDER_MATERIAL, integer face, string render_material ]
PRIM_TEXT 26 プリムのフローティングテキストを設定します。 PRIM_TEXT, string text, vector color, float alpha ]
PRIM_COLOR 18 面の色を設定します。 PRIM_COLOR, integer face, vector color, float alpha ]
PRIM_BUMP_SHINY 19 面の輝きと凹凸を設定します。 PRIM_BUMP_SHINY, integer face, integer shiny, integer bump ]
PRIM_POINT_LIGHT 23 プリムをポイントライトとして設定します。 PRIM_POINT_LIGHT, integer boolean, vector linear_color, float intensity, float radius, float falloff ]
PRIM_REFLECTION_PROBE 44 プリムのリフレクションプローブを設定します

Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

PRIM_REFLECTION_PROBE, integer boolean, float ambiance, float clip_distance, integer flags ]
PRIM_FULLBRIGHT 20 表面の明るさ全開フラグを設定します。 PRIM_FULLBRIGHT, integer face, integer boolean ]
PRIM_FLEXIBLE 21 プリムをフレキシブルに設定します。 PRIM_FLEXIBLE, integer boolean, integer softness, float gravity, float friction, float wind, float tension, vector force ]
PRIM_TEXGEN 22 表面のテクスチャモードを設定します。 PRIM_TEXGEN, integer face, integer type ]
PRIM_GLOW 25 表面のグロー属性を設定します。 PRIM_GLOW, integer face, float intensity ]
PRIM_OMEGA 32 プリムの回転軸と回転速度を設定します。 PRIM_OMEGA, vector axis, float spinrate, float gain ]
PRIM_NORMAL 37 ノーマルマップを設定します PRIM_NORMAL, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians ]
PRIM_SPECULAR 36 スペキュラーマップを設定します PRIM_SPECULAR, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossiness, integer environment ]
PRIM_ALPHA_MODE 38 アルファーレンダリングモードを設定します PRIM_ALPHA_MODE, integer face, integer alpha_mode, integer mask_cutoff ]
PRIM_LINK_TARGET 34 リンクセットの中で使用するリンク番号を設定します。 PRIM_LINK_TARGET, integer link_target ]
PRIM_CAST_SHADOWS 24 プリムのキャストシャドウ属性を設定します。(廃止予定) PRIM_CAST_SHADOWS, integer boolean ]
PRIM_TYPE_LEGACY[1] 1 プリムの形状を設定します。(レガシー項目, 廃止予定) [ 1, integer flag ] + flag_parameters
PRIM_ALLOW_UNSIT 39 Avatars are allowed to manually stand up when seated on this prim. Only valid for prims in a valid experience. [ PRIM_ALLOW_UNSIT, integer boolean ]
PRIM_SCRIPTED_SIT_ONLY 40 Avatars are not permitted to manually sit on this prim. [ PRIM_SCRIPTED_SIT_ONLY, integer boolean ]
PRIM_SIT_TARGET 41 The sit target, if any defined for this prim. [ PRIM_SIT_TARGET, integer boolean, vector offset, rotation rot ]
PRIM_PROJECTOR 42 Light projector settings for this prim. [ PRIM_PROJECTOR, string texture, float fov, float focus, float ambiance ]
PRIM_GLTF_BASE_COLOR 48 Sets the prim's GLTF Material Base Color map attributes.

This parameter's arguments are GLTF overrides.
Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

[ PRIM_GLTF_BASE_COLOR, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector linear_color, float alpha, integer alpha_mode, float alpha_mask_cutoff, integer double_sided ]
PRIM_GLTF_NORMAL 45 Sets the prim's GLTF Material Normal map attributes.

This parameter's arguments are GLTF overrides.
Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

[ PRIM_GLTF_NORMAL, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians ]
PRIM_GLTF_METALLIC_ROUGHNESS 47 Sets the prim's GLTF ORM map attributes (Occlusion, Roughness, Metallic).

This parameter's arguments are GLTF overrides.
Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

[ PRIM_GLTF_METALLIC_ROUGHNESS, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, float metallic_factor, float roughness_factor ]
PRIM_GLTF_EMISSIVE 46 Sets the prim's GLTF Material Emissive map attributes.

This parameter's arguments are GLTF overrides.
Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

[ PRIM_GLTF_EMISSIVE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector emissive_tint ]
パラメータ 付与パラメータ 説明
PRIM_NAME ] 27 [ string name ] プリムの名前を設定します。
PRIM_DESC ] 28 [ string description ] プリムの説明を設定します。
PRIM_TYPE ] 9 [ integer flag ] + flag_parameters プリムの形状を設定します。
フラグ定数 set
PRIM_TYPE_BOX 0 [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]
PRIM_TYPE_CYLINDER 1 [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]
PRIM_TYPE_PRISM 2 [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]
PRIM_TYPE_SPHERE 3 [ integer hole_shape, vector cut, float hollow, vector twist, vector dimple]
PRIM_TYPE_TORUS 4 [ integer hole_shape, vector cut, float hollow, vector twist, vector hole_size, vector top_shear, vector advanced_cut, vector taper, float revolutions, float radius_offset, float skew ]
PRIM_TYPE_TUBE 5 [ integer hole_shape, vector cut, float hollow, vector twist, vector hole_size, vector top_shear, vector advanced_cut, vector taper, float revolutions, float radius_offset, float skew ]
PRIM_TYPE_RING 6 [ integer hole_shape, vector cut, float hollow, vector twist, vector hole_size, vector top_shear, vector advanced_cut, vector taper, float revolutions, float radius_offset, float skew ]
PRIM_TYPE_SCULPT 7 [ string mapinteger type ] Sculpted_Prims:_FAQ
  hole_shape フラグ 形状 hole_shape フラグ 形状
PRIM_HOLE_DEFAULT 0x00 デフォルト PRIM_HOLE_SQUARE 0x20 正方形
PRIM_HOLE_CIRCLE 0x10 サークル PRIM_HOLE_TRIANGLE 0x30 三角形
type フラグ 形状 説明
PRIM_SCULPT_TYPE_SPHERE 1 球形 上端と下端で収束し、左端が右端に縫合される
PRIM_SCULPT_TYPE_TORUS 2 トーラス 上端が下端に縫合され、左端が右端に縫合される
PRIM_SCULPT_TYPE_PLANE 3 平面 収束や縫合は行われない
PRIM_SCULPT_TYPE_CYLINDER 4 シリンダー 左端が右端に縫合される
PRIM_SCULPT_FLAG_ZZZZZZZZ 63
PRIM_SCULPT_FLAG_INVERT 64 裏返し 裏返しに表示 (法線を逆転させる)
PRIM_SCULPT_FLAG_MIRROR 128 ミラー スカルプトされたプリムを X 軸上で反転する
PRIM_SLICE ] 35 [ vector slice ] プリム属性のスライスを設定します。
PRIM_PHYSICS_SHAPE_TYPE ] 30 [ integer type ] プリムの物理形状タイプを設定します。
typeフラグ 説明 ノート
PRIM_PHYSICS_SHAPE_PRIM 0 ノーマルプリム形状の物理に使います メッシュでないオブジェクトのデフォルト値です
PRIM_PHYSICS_SHAPE_CONVEX 2 プリムの凸包形状の物理に使います メッシュオブジェクトのデフォルト値です
PRIM_PHYSICS_SHAPE_NONE 1 プリムの物理形状を無視します これをルートプリム、アバターに適用することはできません

このプリムは、他のオブジェクトやアバターが衝突せずに通り抜けます("ファントム"のように)

PRIM_MATERIAL ] 2 [ integer material ] プリムの素材を設定します。素材は標準の 衝突音スプライト を決定します。 friction coefficient and restitution coefficient.
素材 フラグ 説明 摩擦 反発
PRIM_MATERIAL_STONE 0 石材 0.8 0.4
PRIM_MATERIAL_METAL 1 金属 0.3 0.4
PRIM_MATERIAL_GLASS 2 ガラス 0.2 0.7
PRIM_MATERIAL_WOOD 3 木材 0.6 0.5
PRIM_MATERIAL_FLESH 4 0.9 0.3
PRIM_MATERIAL_PLASTIC 5 プラスチック 0.4 0.7
PRIM_MATERIAL_RUBBER 6 ゴム 0.9 0.9
PRIM_MATERIAL_LIGHT 7 光, 非推奨: [ PRIM_FULLBRIGHT, ALL_SIDES, TRUE ] と同じように見えます 0.6 0.5
PRIM_PHYSICS ] 3 [ integer boolean ] 物理状態を設定します。
PRIM_TEMP_ON_REZ ] 4 [ integer boolean ] テンポラリ属性
PRIM_PHANTOM ] 5 [ integer boolean ] ファントム状態を設定します。
PRIM_POSITION ] 6 [ vector position ] 位置を設定します。
PRIM_POS_LOCAL ] 33 [ vector position ] ローカル位置を設定します。
PRIM_ROTATION ] 8 [ rotation rot ] 回転を設定します。(子プリムでは壊れています)
PRIM_ROT_LOCAL ] 29 [ rotation rot ] ローカル回転を設定します。
PRIM_SIZE ] 7 [ vector size ] 大きさを設定します。
PRIM_TEXTURE, integer face ] 17 [ string texture, vector repeats, vector offsets, float rotation_in_radians ]
テクスチャ: llSetTexture
繰り返し: llScaleTexture
オフセット: llOffsetTexture
回転: llRotateTexture
PRIM_RENDER_MATERIAL, integer face ] 43 [ string render_material ]

Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

マテリアル: llSetRenderMaterial
PRIM_TEXT ] 26 [ string text, vector color, float alpha ] Floating Text: llSetText
PRIM_COLOR, integer face ] 18 [ vector color, float alpha ]
透過: llSetAlpha
: llSetColor
PRIM_BUMP_SHINY, integer face ] 19 integer shiny, integer bump ]
shinybump のフラグ 説明
PRIM_SHINY_NONE 0 なし
PRIM_SHINY_LOW 1
PRIM_SHINY_MEDIUM 2
PRIM_SHINY_HIGH 3
PRIM_BUMP_NONE 0 なし: 凹凸なし
PRIM_BUMP_BRIGHT 1 明るさ:明るい光で生成されるもの
PRIM_BUMP_DARK 2 暗さ:暗い光で生成されるもの
PRIM_BUMP_WOOD 3 木目調
PRIM_BUMP_BARK 4 木の皮
PRIM_BUMP_BRICKS 5 レンガ
PRIM_BUMP_CHECKER 6 チェッカー
PRIM_BUMP_CONCRETE 7 コンクリート
PRIM_BUMP_TILE 8 クラスティ・タイル
PRIM_BUMP_STONE 9 カットストーン:ブロック
PRIM_BUMP_DISKS 10 ディスク:束ねた輪っか
PRIM_BUMP_GRAVEL 11 砂利
PRIM_BUMP_BLOBS 12 ペトリ: 簡単なアメーバのような形状
PRIM_BUMP_SIDING 13 羽目板
PRIM_BUMP_LARGETILE 14 ストーン・タイル
PRIM_BUMP_STUCCO 15 しっくい
PRIM_BUMP_SUCTION 16 吸い込み:リング
PRIM_BUMP_WEAVE 17 織目
PRIM_FULLBRIGHT, integer face ] 20 [ integer boolean ]
PRIM_FLEXIBLE ] 21 [ integer boolean, integer softness, float gravity, float friction, float wind, float tension, vector force ]
PRIM_TEXGEN, integer face ] 22 [ integer mode ]
モード定数 説明
PRIM_TEXGEN_DEFAULT 0
PRIM_TEXGEN_PLANAR 1
PRIM_POINT_LIGHT ] 23 [ integer boolean, vector linear_color, float intensity, float radius, float falloff ] linear_color param accepts color in Linear space - use llsRGB2Linear to convert regular LSL color into Linear space.
PRIM_REFLECTION_PROBE ] 44 [ integer boolean, float ambiance, float clip_distance, integer flags ] Sets the prim's reflection probe parameters.

Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

type Flags V Description Notes
PRIM_REFLECTION_PROBE_BOX/ja 1 Determines if the reflection probe is a box or a sphere. Unset by default (probe is a sphere)
PRIM_REFLECTION_PROBE_DYNAMIC/ja 2 Determines if avatars are included by the probe for imaging. Unset by default (probe does not image avatars). Imaging avatars in probes has a performance cost.
PRIM_GLOW, integer face ] 25 [ float intensity ]
PRIM_OMEGA ] 32 vector axis, float spinrate, float gain ] llTargetOmega
PRIM_NORMAL, integer face ] 37 string texture, vector repeats, vector offsets, float rotation_in_radians ]
PRIM_SPECULAR, integer face ] 36 string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossiness integer environment ]
PRIM_ALPHA_MODE, integer face ] 38 integer alpha_mode, integer mask_cutoff ]
34 [] 複数のllSetLinkPrimitiveParamsを呼び出します。
PRIM_CAST_SHADOWS ] 24 [ integer boolean ] 廃止予定: プリミティブに影を割り付ける
[ 1 ]
PRIM_TYPE_LEGACY[1]
1 [ integer flag] + flag_parameters
flag 定数 フラグパラメータ
PRIM_TYPE_BOX 0 [ vector cut, float hollow, float twist_end, vector top_size, vector top_shear ]
PRIM_TYPE_CYLINDER 1 [ vector cut, float hollow, float twist_end, vector top_size, vector top_shear ]
PRIM_TYPE_PRISM 2 [ vector cut, float hollow, float twist_end, vector top_size, vector top_shear ]
PRIM_TYPE_SPHERE 3 [ vector cut, float hollow, vector dimple ]
PRIM_TYPE_TORUS 4 [ vector cut, float hollow, float twist_end, float hole_size_y, vector top_shear, vector advanced_cut ]
PRIM_TYPE_TUBE 5 [ vector cut, float hollow, float twist_end, float topshear_x ]
PRIM_ALLOW_UNSIT ] 39 [ integer boolean ]
PRIM_SCRIPTED_SIT_ONLY ] 40 [ integer boolean ]
PRIM_SIT_TARGET ] 41 [ integer boolean , vector offset, rotation rot ] Sit target, llSitTarget. The position can be ZERO_VECTOR.
PRIM_PROJECTOR ] 42 [ string texture, float fov, float focus, float ambiance ] Light projector settings, the texture may be NULL_KEY. (Write only, for now. See here)
PRIM_GLTF_BASE_COLOR, integer face ] 48 string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, float alpha, integer alpha_mode, float alpha_mask_cutoff, integer double_sided ] linear_color param accepts color in Linear space - use llsRGB2Linear/ja to convert regular LSL color into Linear space.

This parameter's arguments are GLTF overrides.
Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

PRIM_GLTF_NORMAL, integer face ] 45 string texture, vector repeats, vector offsets, float rotation_in_radians ] This parameter's arguments are GLTF overrides.


Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

PRIM_GLTF_METALLIC_ROUGHNESS, integer face ] 47 string texture, vector repeats, vector offsets, float rotation_in_radians, float metallic_factor, float roughness_factor ] This parameter's arguments are GLTF overrides.


Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

PRIM_GLTF_EMISSIVE, integer face ] 46 string texture, vector repeats, vector offsets, float rotation_in_radians, vector emissive_tint ] emissive_tint param accepts color in Linear space - use llsRGB2Linear/ja to convert regular LSL color into Linear space.

This parameter's arguments are GLTF overrides.
Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer.

警告

  • この関数は 0.2 秒間、スクリプトを停止します。
  • texture がプリムの中で見つからない場合、かつこれが UUID でない場合、またはこれがtextureでない場合、エラーが DEBUG_CHANNEL 上で叫ばれます。
  • textureUUID である場合、オブジェクト自体に新たな アセット権限 が発生するようなことはありません。
    • アセットをプリムのインベントリの中に置いた場合、これまで発生していた使用制限は新しいオブジェクトで新たに作成されません。
  • If render_material is missing from the prim's inventory and it is not a UUID or it is not a material then an error is shouted on DEBUG_CHANNEL.
  • If render_material is a UUID then there are no new asset permissions consequences for the object.
    • The resulting object develops no new usage restrictions that might have occurred if the asset had been placed in the prims inventory.
  • ストレージ媒体として フローティングテキスト の機能が使えると思わないでください。これは不完全ですし、安全なものでもありません。
    • フローティングテキストはサーバの更新時に変更になったことが過去にあり、その際に既に設定されている内容は消去されていました。将来も変更が発生する可能性があります。
    • 「不可視」[2] のフローティングテキストもクライアントに送信されます。
      • 不可視にしているテキストを表示することのできるクライアントを持っている人が見れてしまう可能性があります。
      • テキストが含まれている通信パケットが盗聴され、テキストが読まれる可能性があります。
  • PRIM_TYPE can only be used with LINK_SET if the object contains 10 or fewer prims. It can only be used with LINK_ALL_OTHERS or LINK_ALL_CHILDREN if the object contains 11 or fewer prims. If there are more prims, the operation will fail and an error will be shouted to DEBUG_CHANNEL. Work around this by looping through the prims with llSetLinkPrimitiveParamsFast.
  • PRIM_TYPE will silently fail when executed by a script placed inside a mesh, whether the affect object is the mesh or not (in linksets for example), use a normal prim as your root prim.
  • top_size とクライアントの値は異なります。範囲は一致しておらず、変換が必要です。シンプルな計算式は、結果 = 1.0 - value です。詳細は top_size Explained をご覧ください。
  • map がプリムの中で見つからない場合、かつこれが UUID でない場合、またはこれがtextureでない場合、エラーが DEBUG_CHANNEL 上で叫ばれます。
  • mapUUID である場合、オブジェクト自体に新たな アセット権限 が発生するようなことはありません。
    • アセットをプリムのインベントリの中に置いた場合、これまで発生していた使用制限は新しいオブジェクトで新たに作成されません。
  • PRIM_POSITION caveats
    • 状況によって positionローカル座標リージョン座標 のどちらかを指定する必要があります。詳細は llSetPosの仕様 を参照してください。
    • アタッチされていないルートプリムの場合、プリムが動ける範囲は限られています。PRIM_POSITION 1 コールあたり 10m に制限されています。WarpPos を参照してください。これは非常に特殊なケースです。 Do not rely on rule duplication of other flags - 結果は不定で、将来 きっと 壊れます。
    • PRIM_POSITIONアバター を動かすときは、
      • アバターが座っているプリムを動かしてもアバターは動きません。
      • アバターを動かしても、アバターが座っているプリムは動きません。
      • 座っている位置の座標はプリムの座標に素直に連動しません。SitTargetを更新 を使ってください。
      • position が中心から 54 メートルを超えると、エラーを出さずに失敗します。
  • PRIM_OMEGA/ja on nonphysical objects, and child prims of physical objects, is only a client side effect; the object or prim will collide as non-moving geometry.
  • PRIM_OMEGA/ja cannot be used on avatars sitting on the object. It will emit the error message "PRIM_OMEGA disallowed on agent".
  • If PRIM_OMEGA/ja does not appear to be working, make sure that that Develop > Network > Velocity Interpolate Objects is enabled on the viewer.
  • In the parameters returned by llGetPrimitiveParams([PRIM_OMEGA/ja]), the vector is normalized, and the spinrate is multiplied by the magnitude of the original vector.
  • If texture is missing from the prim's inventory and it is not a UUID or it is not a texture then an error is shouted on DEBUG_CHANNEL.
  • If texture is a UUID then there are no new asset permissions consequences for the object.
    • The resulting object develops no new usage restrictions that might have occurred if the asset had been placed in the prims inventory.
  • repeats is not only used to set the number of repeats but the sign of the individual components is also used to set the "Flip" attribute.
  • To clear the normal map parameters from the face (and possibly remove the material), set texture to NULL_KEY (the other parameters must be supplied in this case but will be ignored).
  • Note that whenever any face in a linkset contains a material (i.e. has a non-default PRIM_NORMAL, PRIM_SPECULAR, or PRIM_ALPHA_MODE), the linkset will use the new accounting system.
  • In the default texture mapping mode the texture repeats units are in texture repeats per face. In the planar texture mapping mode the texture repeats units are in texture repeats per half meter. This is in contrast to the in-world editing tool, in which the planar texture scaling units are repeats per meter.
  • texture がプリムの中で見つからない場合、かつこれが UUID でない場合、またはこれがtextureでない場合、エラーが DEBUG_CHANNEL 上で叫ばれます。
  • textureUUID である場合、オブジェクト自体に新たな アセット権限 が発生するようなことはありません。
    • アセットをプリムのインベントリの中に置いた場合、これまで発生していた使用制限は新しいオブジェクトで新たに作成されません。
  • repeats is not only used to set the number of repeats but the sign of the individual components is also used to set the "Flip" attribute.
  • To clear the specular map parameters from the face (and possibly remove the material), set texture to NULL_KEY (the other parameters must be supplied in this case but will be ignored).
  • Note that whenever any face in a linkset contains a material (i.e. has a non-default PRIM_NORMAL, PRIM_SPECULAR, or PRIM_ALPHA_MODE), the linkset will use the new accounting system.
  • In the default texture mapping mode the texture repeats units are in texture repeats per face. In the planar texture mapping mode the texture repeats units are in texture repeats per half meter. This is in contrast to the in-world editing tool, in which the planar texture scaling units are repeats per meter.
  • faceALL_SIDES であれば flag は全ての面に作用します。
  • face が存在しない面を指している場合、 flag はエラーを出さずに復帰します。
  • スクリプトは、2004年9月以前のものはPRIM_TYPEが1の値を示すかどうかで書かれていました。これらのスクリプトが再コンパイルされる場合、新しい値のPRIM_TYPEはコンパイルエラーを起こすでしょう。
    • 修正するには、これをPRIM_TYPEフラグと1の値に置き換えるか、新しいPRIM_TYPE構文にアップデートします。
  • PRIM_ROTATION は子プリムでバグがあります。議論と修正については特記事項を参照してください。
  • この関数は与えられたデータの型が間違っていたらエラーを返します。これは、ユーザ入力やノートカードでデータを渡すときに問題になってきます。改善するには、この List Cast 関数を参照してください。 list_cast

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   We need PRIM_ALPHA_MODE_DEFAULT to revert alpha to old "if the texture has an alpha mask, use alpha. If not, don't" behavior.

サンプル

// プリムの全ての面を黒にします。面番号 3 の面だけは白くします。
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <0.0,0.0,0.0>, 1.0]);
llSetPrimitiveParams([PRIM_COLOR, 3, <1.0,1.0,1.0>, 1.0]);

// 面番号 3 の面を描画します。
// 画像を UUID で指定して... 
// 面ごとに繰り返す数をベクトルに指定して、
// テクスチャのずれを 2 番目のベクトルに指定して
// テクスチャの回転を浮動小数点数で指定します。
llSetPrimitiveParams([PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0,1.0,0.0>, <0.0,0.0,0.0>, 0.0]);

// 面番号 3 を「フルブライト」にします。
llSetPrimitiveParams([PRIM_FULLBRIGHT,3,TRUE]);

// そしてこれらを一気にやる方法です。
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <0.0,0.0,0.0>, 1.0,
                      PRIM_COLOR, 3, <1.0,1.0,1.0>, 1.0,
                      PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0,1.0,0.0>, <0.0,0.0,0.0>, 0.0,
                      PRIM_FULLBRIGHT, 3, TRUE]);

//さらにこれをベッドの上に置いて、よく眠れるようにしたいとき、その座標が例えば <x, y, z> なら
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <0.0,0.0,0.0>, 1.0, 
                      PRIM_COLOR, 3, <1.0,1.0,1.0>, 1.0,
                      PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0,1.0,0.0>, <0.0,0.0,0.0>,0.0,
                      PRIM_FULLBRIGHT, 3, TRUE, 
                      PRIM_POSITION, <x, y, z>]);

//複数の面に時間のペナルティなしでテクスチャを一度に設定することができます。
//パラメタを設定するぶん繰り返すだけです。
llSetPrimitiveParams([
        PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288",
            <1.0,1.0,0.0>, <0.0,0.0,0.0>, 0.0,
        PRIM_TEXTURE, 4, "4d304955-2b01-c6c6-f545-c1ae1e618288",
            <1.0,1.0,0.0>, <0.0,0.0,0.0>, 0.0
    ]);

Top-size (テーパー)

default
{
    state_entry()
    {
        vector XYZ = llGetScale();
        float X = XYZ.x;
        float Y = XYZ.y;     
        llSetPrimitiveParams([PRIM_SIZE, <X,Y,0.1>, // プリムを薄くしておきます
                              PRIM_TYPE, PRIM_TYPE_BOX, 0, <0.0,1.0,0.0>, 0.0, ZERO_VECTOR, 
                              <1.0 - (0.4 / X), 1.0 - (0.4 / Y), 0.0>,
                              ZERO_VECTOR]); //方程式「解 = 1 - 希望するテーパー」を使用します
        //プリムの大きさが変更になっても top-size (テーパー) の比が維持される (できるだけ近づく) ようになります。
        //上の比率はでいい感じの額縁のようなものを作ることができます。
    }
    changed(integer change)
    {
        if(change & CHANGED_SCALE)
        {
            llResetScript();
        }
    }
}

注意点

リンク番号

オブジェクトを構成するそれぞれのプリムにはアドレスがあります。それがリンク番号です。オブジェクトの特定のプリムにアクセスするには、そのプリムのリンク番号を知らなければなりません。リンク番号はプリムに振られますが、オブジェクトに座っているアバターにも振られます。

  • オブジェクトが単一のプリムで構成されていて、アバターが座っていないとき、(ルート)プリムのリンク番号は 0 です。
  • しかし、オブジェクトが複数のプリムで構成されていたり、オブジェクトに座っているアバターがいたりすると、ルートプリムのリンク番号は 1 となります。

アバターがオブジェクトに座ると、リンクセットの末尾に追加され、いちばん大きなリンク番号が振られることになります。さらに、アバターがオブジェクトに座っている場合、アバターを立たせないと、プリムのリンク・リンク解除ができません。

プリムやアバターの数え方

オブジェクトのプリムや、プリムに座っているアバターの数を調べるのに、2つの関数があります。

  • llGetNumberOfPrims() - プリムと座っているアバターの数を返します。
  • llGetObjectPrimCount(llGetKey()) - オブジェクトのプリムの数だけを返しますが、アタッチメントとなっている場合は 0 を返します。
integer GetPrimCount() { //常にプリムの数だけを返します。
    if(llGetAttached())//装着されているか?
        return llGetNumberOfPrims();//アバターとプリムの数を返しますが、アタッチメントの上には座れないのでこれでいいです。
    return llGetObjectPrimCount(llGetKey());//プリムの数だけを返しますが、アタッチメントの場合ここは通りません。
}

(PRIM_TYPE_LEGACYと名づけられた)古いPRIM_TYPEのインターフェイスは廃れた技術として使用が廃止されました。

関連項目

関数

•  llGetLinkNumber スクリプトが入っているプリムのリンク番号を取得します。
•  llGetPrimitiveParams 多くのプリムのパラメータを取得します
•  llSetLinkPrimitiveParams
•  llSetAlpha アルファ(透明度)を設定する簡単な方法です
•  llSetTexture テクスチャを設定する簡単な方法です
•  llSetColor 色を設定する簡単な方法です
•  llSetScale 大きさを設定する簡単な方法です
•  llSetStatus 物理属性とファントムを設定する簡単な方法です

記事

•  各種制限 SL の制限と制約
•  LSL での色
•  透明度
•  LSL での色
•  透明度

特記事項

PRIM_TYPE の top_size とクライアントのテーパー変換
範囲 尖る 尖らない 底が尖る
クライアント [-1, 1] 1.0 0.0 -1.0
PRIM_TYPE [0, 2] 0.0 1.0 2.0
LEGACY [0, 1] 0.0 1.0 なし
1.11 以前 [0, 1] 0.0 1.0 なし

top_size について解説

もともとの PRIM_TYPE のインターフェースが廃止されたとき (PRIM_TYPE_LEGACY, SL 1.5)、新しい PRIM_TYPE インターフェースはプリムの底を尖らせる機能がまだサポートされておらず、SL 1.11 (2年後) になってようやく導入されました。これが導入され新しい PRIM_TYPE が廃止されたときに、top_size の範囲が拡張されました。 それまでの間、クライアントの中で属性とその定義値が再定義されていました。この再定義と範囲の拡張により、異なる値で同じことをする2つのインターフェースが存在することになりました。それまでの間 PRIM_TYPE_LEGACY のインターフェースは更新されず、プリムの底を尖らせるのはサポートされないままでした。その結果、3つのインターフェースがそれぞれ異なる範囲をもつことになり、いじわるな警告をつけるはめになってしまいました。

All Issues

~ Search JIRA for related Issues
   CHANGED_TEXTURE is not triggered when texture is changed via script
   CHANGED_TEXTURE is not triggered when texture is changed via script
   llSetRot and llSetPrimitiveParams (using PRIM_ROTATION) incorrectly implemented for child prims.
   CHANGED_TEXTURE is not triggered when texture is changed via script
   CHANGED_TEXTURE is not triggered when texture is changed via script
   We need PRIM_ALPHA_MODE_DEFAULT to revert alpha to old "if the texture has an alpha mask, use alpha. If not, don't" behavior.

脚注

  1. ^ When LL deprecated this flag they stripped it of it's name, however they did not remove the functionality. To aid in documenting the functionality, the value was given a new name in the documentation only. That is why PRIM_TYPE_LEGACY is not recognized by the compiler.
  2. ^ フローティングテキストの alpha を 1.0 に設定すると「不可視」になります。
  3. ^ 記事中の範囲は、 実数空間 に記載されているものです。

Signature

function void llSetPrimitiveParams( list rules );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。