' Set up a sphere with a texture projection and texture image.
CreatePrim "Sphere", "MeshSurface"
CreateProjection "sphere", , siTxtDefaultPlanarXY, , "Texture_Projection"
BlendInTextureLayers , , 1, True, siReplaceAndNoBlendInTextureLayers
SetDisplayMode "Camera", "texturedecal"
' Put an animated twist after the texture projection, so the texture sticks to the surface.
ApplyOp "Twist", "sphere", 3, siPersistentOperation, , 0
SaveKey "sphere.polymsh.twistop.angle", 1, -300
SaveKey "sphere.polymsh.twistop.angle", 100, 300
MsgBox "The projection is evaluated before the twist, so the texture sticks to the surface."
' Now modify the projection to swim: the operator is placed at the top of the stack and
' any deformations occur before the UV property is computed.
SwimUVW "sphere"
MsgBox "The projection is now evaluated after the twist, so the texture swims on the surface."
' Perform a new modeling operation. Note that the texture still swims on the surface.
SelectGeometryComponents "sphere.pnt[27]"
Translate , 3.66557060971011, 4.9427099682274, -0.49427099682274, siRelative, siView, siObj, siXYZ, , , , , , , , , , 0
MsgBox "New modeling operations are inserted in the stack below the texture read position."
' Play back the animation. Note the texture swims on the surface.
PlayForwardsFromStart |