Using Animesh and UVW_Xform to paint a scrolling texture.
Come here for tutorials and 3d training. The aim is to point out good 3d training sites or methods.

Moderators: Winterhawk99, Mermut, Bannor Bloodfist

Post Reply
User avatar
Bannor Bloodfist
Posts: 1309
Joined: Fri Oct 09, 2009 11:45 pm
ctp: Yes
dla: Yes
TBotR: Yes
nwnihof: Yes

Using Animesh and UVW_Xform to paint a scrolling texture.

Post by Bannor Bloodfist »

This tutorial will show you how to use YVW_Xform to paint a scrolling texture onto an object.

Why might you wish to do this?

You can scroll a texture for something like a stream, or flow of lava... to give the illusion of moving water etc. You might also use this same technique to make a scrolling text box, something like a news blurb you see scrolling across the bottom of the CNN news screen. (Obviously for some sort of futuristic or planar world).

Some notes before we start:

1) This tutorial was made possible by an idea and set of files (which you don't need) to display a waterfall created by NWN_Baba_Yaga as found in this thread on the Bioware Social Forums.
2) We will NOT be actually animating (moving) anything in the object itself. The object will not move from it's original location. The TEXTURE will do the movement. As if the texture was dragged up/down or sideways across an the object.
3) This is really a simple thing to accomplish, but that is assuming you know the basics about using 3ds max, Modifiers, animation bar etc. I will show some of those steps, but anything you find missing that you really need help with, please let me know and I will attempt to adjust this tutorial.
4) There are a LOT of screenshots, but most are just to show how the animation plays out, using still photo's instead of a video.
5) We will be using the special NWN AuroraAnimesh modifier, but again, this modifier is not used to actually animate the mesh itself, but to animate the painting of the texture onto that object. This is a distinction you need to keep in mind. The AuroraAnimesh modifier is required to allow you to also use the UVW_X-form modifier, or at least, it is required by NWN to allow that sort of animated texture.
6) This is very, VERY, VERY important. SAVE YOUR MAX SCENE FILE. You WILL need it. The various utilities that allow you to import/export models for use with NWN have a bug that does NOT handle re-importing animations very well. The bugs are various and numerous, and typically completely trash the animation sequences on import. So, save your max scene, using file/save, and append an 01 to the end of the name of it when you save, as in: my_file_01. Then, whenever you save again (Ctrl-s) or File save, 3dsmax will automatically update the end number, as in if you start with my_file_01, max will automatically up that number to my_file_02 etc each time you save. KEEP your max scenes, KEEP the variations. Mistakes are easily made, and very painful when you have to re-start from scratch. Once you have a final working version, you can delete the previous saves, and just keep the final max scene (in case you think you may wish to add/modify/edit) the one you think is final.


Additional notes on things you need:
1) You need 3dsmax (although a lot of this CAN be used in Gmax as well, I don't have Gmax, so I can't tell you how to find the options there.)
2) You need at least one texture that you wish to animate. This texture should have details/features to it that are easily seen. Ie, a flat plain bit of Image plain brown will NOT work. But a detailed texture like Image that will give the illusion of motion.
3) You need at least one object on which to paint that texture.
CTP Team Lead

User avatar
Bannor Bloodfist
Posts: 1309
Joined: Fri Oct 09, 2009 11:45 pm
ctp: Yes
dla: Yes
TBotR: Yes
nwnihof: Yes

Re: Using Animesh and UVW_Xform to paint a scrolling texture

Post by Bannor Bloodfist »

Ok, here goes:

Open your mdl file in 3dsmax. I am using the files provided by NWN_Baba_Yaga from the forum thread listed above simply to make this entire tutorial easier to create. It has a simple model that is intended to be a waterfall placeable. However, this technique can be used on any object in your mdl.

You should note that the more animesh objects you have in a given area, the greater the likelihood for that area to really lag. Using Animesh is processor intensive, even on newer computers. However, it can really give some amazing results when used judiciously.

I again, am assuming you have the object already created, and a mdl base etc... Should look something like the following picture, but can be any shaped object of any size etc, as long as your file already has a mdl base and the mdl base has at least one animation sequence defined.

Image

In that scene, you can see that I have selected the mdl base, to show the various details. Details like the default animation etc.

If you don't already have a default animation sequence defined for the specific mdl, they are fairly easy to generate.

We want to name it, define it's starting position, ending position, and sampling rate. (Pic will follow once I create one) You can see those details in the pic provided, and you can see that the default animation created for the mdl base, is automatically inherited onto/into the object (in this case the object is called "waterfall_back", and it's details are already filled in for you by inheriting from the mdl base. This happens when you "link" the "waterfall_back" object to the mdl base and then apply the "AuroraAnimesh" modifier onto the stack.

Once you have those basics, we can proceed with editing the specific features of the UVW_XForm modifier and the modifier stack in general.

Image


Note: I did not select anything in the stack, simply so that you could actually read everything in that stack. When selected, the object selected changes to a black text on grey background which prevents a good screen capture.

However, you can see that the "default" animation sequence as defined for the mdl base, is automatically filled into the data for the object. That screen only shows that there IS an animation defined, that the animation is called "default" and starts at position 5 on the animation bar, ends at position 30, is sampled at 0.25 with a value of 1 for the mapping channel. This is the section that looks like the following shot:
Image

Note that we are deliberately leaving the number of samples at ZERO for this animation.
CTP Team Lead

User avatar
Bannor Bloodfist
Posts: 1309
Joined: Fri Oct 09, 2009 11:45 pm
ctp: Yes
dla: Yes
TBotR: Yes
nwnihof: Yes

Re: Using Animesh and UVW_Xform to paint a scrolling texture

Post by Bannor Bloodfist »

Next we go to the modifier stack, and select the UVW_Xform modifier to adjust it's settings:

Image

And note where we are located on the animation bar sequence as well:

Image

The 2nd - 4th images are primarily to show how the texture scrolls as we make the adjustments to the "V" modifier at each key position on the animation bar.

Image
Image
Image

As you should be able to see in the fourth image, I have also shown how to generate a NEW key position on the animation bar, just in case you do not already know how that is accomplished.

So, what we have seen is that you can edit the position of the texture simply by changing the point at which the texture is mapped onto the object. We "scrolled" the texture in a vertical motion across the object, giving the illusion of flowing water down a waterfall.

This can be applied to other objects or textures to perform different things, like flowing water along a stream, flowing lava, or even making an animated scrolling text.

P.S. I apologize for the downsizing that occurs by using photobucket, as it makes some of the text inside the screen captures a bit difficult to read. I can provide you with the original screen captures which are of much higher quality (and size) if you send me a pm here.
CTP Team Lead

Post Reply