StickUVW

Description

If a texture projection operator is reading from somewhere above the Modeling region, StickUVW changes the texture projection operator to read from the top of the Modeling stack (so that UVs are computed after modeling deforms but before shape animation or enveloping). Textures using these coordinates will appear to stick as the object is deformed by shape animation or enveloping.

StickUVW takes a list of objects and UV properties (texture projections) as input. If an object is a primitive, such as a mesh or a NURBS surface, the command changes the current UV properties used by the materials (see Material.CurrentUV) assigned to the object. If a texture projection does not have an operator (because the operator was frozen), the command has no effect.

Scripting Syntax

StickUVW( [InputObjs] );

Parameters

Parameter Type Description
InputObjs String List of objects and UV properties (texture projections).

Default Value: Selected objects

Examples

VBScript Example

' Create a sphere with a texture and an XY projection.

CreatePrim "Sphere", "MeshSurface"

CreateProjection "sphere", , siTxtDefaultPlanarXY, , "Texture_Projection"

BlendInTextureLayers , , 1, True, siReplaceAndNoBlendInTextureLayers

SetDisplayMode "Camera", "texturedecal"

' Create a skeleton and envelope it with the sphere.

Create2DSkeleton -4.12810223136029, -2.64625212911425, 0.264625212911426, 0.95263897646775, 3.19920033519785, -0.319920033519786, -5.71059313749964, 0, 0, 4

AppendBone "eff", 5.9143003122372, -3.23869663563226, 0.323869663563226

ApplyFlexEnv "sphere;root,bone,bone1,eff", False, 2

SelectObj "eff", , True

Translate , -4.64411501028021, 0.276474103041814, -2.76474103041813E-02, siRelative, siView, siObj, siXYZ, , , , , , , , , , 2

SaveKey "eff.kine.local.posx,eff.kine.local.posy,eff.kine.local.posz", 1

Translate , 5.19982107988636, 0.118488901303611, -1.18488901303611E-02, siRelative, siView, siObj, siXYZ, , , , , , , , , , 2

SaveKey "eff.kine.local.posx,eff.kine.local.posy,eff.kine.local.posz", 80

SetValue "PlayControl.Current", 2

Refresh

SetValue "PlayControl.Current", 1

' Make the UV swim by making the texture projection operator read from the top of the operator stack, 

' so that it is applied after the object is enveloped.

SwimUVW "sphere"

MsgBox "The projection is evaluated after the enveloping, so the texture swims on the surface."

SetValue "PlayControl.Current", 50

Refresh

MsgBox "Note that the texture swam on the surface when the bone moved."

' Make the texture stick so that it is no longer affected by the enveloping.

StickUVW "sphere"

MsgBox "StickUVW was called, so the projection is now evaluated before the enveloping. Click OK to see the bone animated."

' Play the animation back: the texture is not affected by the enveloping.

PlayForwardsFromStart

See Also

SwimUVW ReprojectUVW CreateProjection CreateSubprojection