Menu Close

3dsMax 2022 Modifier Modernization & Performance Improvement (includes 3dsMax 2021 PUs)

3dsMax is now 25 years old program. But, that doesn’t mean that all its core is 25 years old. The core of 3dsMax has been continuously updated and being updated at this moment. Upgrading core while not breaking the existing feature is a monumental task. It is very difficult and somewhat boring. But, that hasn’t stop 3dsMax team.

After 3dsMax 2021 has been released, 3dsMax developers put some great effort for modernizing modifiers and underlying cores related to modifiers I made a comprehensive list of the efforts since this kinds of things are hard to show as video.

EditPoly Remove Edges/Vertices [2533x!]

This was a typical case of “a good sample file load to fast and effective fix” case. I had to lower the poly count of a model which already had animation. I applied Edit Poly and was removing many extra loops. But, it was so slow as I remove more and more loops. I sent the max file to 3dsMax dev team. I got the fix. 3dsMax dev accelerated EditPoly Remove edges (with ctrl on) and Remove vertices in various places (including EditablePoly). How much is it improved? A LOT. REALLY A LOT.

I tested on an object with 318402 verts  and removed 238,800 verts from it.
2021.3 : 4276.9 seconds
2022 : 1.688 seconds : 253370% improvement
2533 times faster!

Since Edit Poly is recomputed when you open a max file. It will also improve file loading time a lot if you have many deleted many verts with Edit Poly.

This change break backward compatibility. This means you will not see improvements when loading old files. Only the newly added Edit Poly modifier will use this improvement. Saving to previous versions will collapse EditPoly.

Bevel Faces and to a lesser extent Chamfer Edges [22x]

3dsMax dev accelerated underlying algorithms of Bevel Faces and Chamfer Edges.  This change will also accelerate any code which uses max’s “mesh clusters”. One of test showed.
2021.3 : 85 seconds
2022 : 4 second. 2125% improvement

Auto Smooth [ 3.8x – 3057x ]

The underlying auto smooth algorithm has been totally revamped which means this improvement not just for Smooth modifier. EditableMesh and EditablePoly AutoSmooth command, EditMesh and EditPoly Autosmooth command, Autosmooth modifier and Renderable Spline with Autosmooth on.

The performance gains are significant. Yes, you saw it right in the headline. One of models showed 3000 times faster performance. The particular model was tree from MaxTree. Tons of elements. Most million+ big mesh shows 30-40 times faster performance. Now Smooth modifier is faster than any other 3rd party solution.

MaxTree model / Verts : 4,467,434 / faces  : 1,381,628
2021.3 :  6664.69 seconds
2022 : 2.18 seconds : 305719% improvement
3057 times faster

An Engine CAD model / Verts : 2,260,497 / faces  : 4,516,570
2021.3 :  74.853 seconds
2022 : 2.207 seconds : 3391% improvement

Turning on Enable in Viewport for an imported spline pattern / 523k knots.
2021.3 : 724.388 seconds
2022 : 12.432 seconds : 5826% improvement

Extrude [ 4.5x – 130x ]

Optimized capping provides significant performance improvement for complex shape with a lot of elements. Also it is now cache the capped shape. Therefore, when you adjust the amount value, you can see the change instantly.

A spline with 220 spline / 523,176 points
2021.3 : 3576.56  seconds
2022 : 27.7 seconds : 12911% improvement

Relax [ 1.5x – 3x ]

It is fully multi-threaded now. It also provide the volume preservation option.

Stanford dragon model / Verts : 3,609,455 / faces  : 7,218,906
2021.3 :  21.5 seconds
2022 : 7.22 seconds : 297% improvement

Slice/Symmetry [ 1.5x – 3x ]

This modifier has some story. In the legacy Slice modifier, there is a mode button at the bottom which is set to “Poly” by default. I never paid attention to this button. But, apparently this button determines which data structure Slice would operate on. That means if you apply a Slice modifier on a mesh object. It will convert to editable poly first(!) and slice. This means there will be the conversion tax. On top of that, slicing poly is slower than slicing mesh. When I change the mode to mesh for highres mesh object, even the legacy Slice was not that slow.

Now, “Automatic” option has been added and is ON by default. It will use whatever native type which is coming from stack. BUT! Here is a catch. Because mesh slicing in 2022 is so fast now. Even with conversion tax, slicing in mesh mode is always faster. Therefore, I recommend to set to mesh especially you would use mesh for the above level.

Measuring performance was a little bit tricky because the shape of slice has greater effect than tri count. So, I applied Slice and animate rotation and measured the average time.

Stanford dragon model / Verts : 3,609,455 / faces  : 7,218,906
MESH
2021.3 :  2.88 seconds
2022 : 1.00 seconds : 286.73% improvement

I mentioned that 2021.3 default is set to “Poly”. If I don’t change this option as Mesh. It took  9.49 second! Therefore, when you apply Slice modifier on a mesh object. the improvement is actually 900% compare to 2021 when you use the default option.

POLY
2021.3 :  7.22 seconds
2022 : 5.08 seconds  – 141.95% improvement
2022 as mesh : 2.52 second – 286.66% improvement

One more tip. When your sliced a section with a lot of elements, somehow mesh slicing slowed down a lot. It is not sure what is causing an issue as of now. But, dev need to investigate what’s going on. Good news is. Poly performs very well for this case.

This is a test with 100 elements in section.
2021.3 Mesh : 4.91 seconds
2021.3 Poly : 0.22 seconds
2022 Poly : 0.19 seconds

PathDeform [ 3x – 20x ] – 3dsMax 2021 PU3

PathDeform is now fully multi-threaded. You can see hi poly models shows 20 times faster performance.

A CAD Tank thread model / Verts : 1,078,300 / faces  : 2,161,000
2021.3 :  63.463 seconds
2022 : 2.793 seconds : 2272.4% improvement

Stanford dragon model / Verts : 3,609,455 / faces  : 7,218,906
2021.3 :  9.773 seconds
2022 : 0.497 seconds : 1966% improvement

Push [ 1.5x – 5x ] – 3dsMax 2021 PU2

PathDeform is now fully multi-threaded. In the past, poly was performing worse than mesh. Now it is fixed. There is not much difference between mesh and poly. Therefore, you will see bigger improvement on poly objects.

Stanford dragon model as poly  / Verts : 3,609,455 / faces  : 7,218,906
2020 :  2.623 seconds
2021 : 0.842 seconds : 311% improvement

DCM mini tutorial #1 – Smooth Push

I made this DCM(DataChannel Modifier) while ago to help my friend’s shot. I thought that it might be worth as my first DCM mini tutorial. So, here we go!

Let’s see the following picture. This is the famous Stanford Bunny model. Left is the original shape. The right is 3dsMax Push modifier. As you can see, when you push a lot the faces start to overlap. The middle is the result of “Smooth Push” which is a simple DCM setup. As you can see It pushed it, but it pushes more gently(?).

How Push modifier works is really really simple. It moves each verts along the its normal by the given amount. As you can see, Push modifier only has one parameter which is the distance the verts are moved along normals.

Becase the verts move along the normal, verts will meet each other if you have concave shape. To prevent that, I simple smooth or blurred or relaxed the normals and used that. Let’s see how that translate to DCM setup.

First, we need to get vertex normal for each verts.

  1. Click “Add Operator”
  2. Add “Vertex Input”.
  3. Choose “Average Normals”.

As an Input operator, Vertex Input allow you to grab various data from each verts. The 3 dot icon in front of operator name indicates, you are processing vertex data.

Next, Add “Smooth” operator from Process operators. It has 2 values, Iteration and Amount just like Relax modifier. The bigger Iteration and Amount is, the the smoother result you will get. This operator will make more gentle normals by averaging normals with neighboring normals just like blurring an image.

Now we need to have a way to control amount of Push. This is simple. Let’s add “Scale” operator from Process operators. This operator multiplies the given value to float or vector. If the value is 1.0. The size of normal doesn’t change. If the value is 1.0, you ar making normal bigger. If the value is less than 1.0, you are making normal smaller. This is exactly what “Push value” in Push modifier does.

What we have now in the current Data Channel is the offset vector of the each vertex. So, you need to add these vectors to the original vertex position.

  1. Add Vertex Output operator from Output operators.
  2. Choose “Position” as output channel.
  3. Change “Selection Method” from “Replace” to “Add”, which means you will add the current channel data to the existing vertex position data.

Dadah! You have a Smooth Push! Easy, right?

You know what’s also easy? renderStacks! Try it, your rendering life will become 1000% easier!

3dsMax tips #5 – Make SkinWrap faster

Often the riggers skin a low res character and use it to drive hires version of character with SkinWrap modifier.

When you use SkinWrap, your driver object need to be Mesh object. If it is not, it will convert to poly under the hood. The mesh <> poly conversion price is very high.When I tested this originally in 3dsMax 2014. The test result was 9.75fps vs 17.89fps. I retested other file in 2021.3. The difference was 10.8fps vs 13.1 fps. So, I guess there has been some progress. It is still taxing 30%.

Skin modifier doesn’t care about poly or mesh. Therefore, if your base object is Editable Poly, just apply Mesh Select before Skin. You will get performance boost.

3dsMax 2021.3 Retopology Modifier Quick Start – Part.2

OK. Part.2! In this post, we will focus on object with hard edges like booleaned model or CAD data.

Booleand Model

Booleaned model is usually pretty easy. Applying Retopology modifier, set the target number and pressing Compute is enough.  But, again it might fail sometime, and you simply want to get better result. So, here is some tips for booleaned model.

Tips

  • Utilize Boolean Seams for very low angle sharp edges
  • Regularize option can help to get more even quad distribution and prevent spiral loops.
  • Adding Subdivide modifier can help a lot to solve and get better result.
  • Having some support edges helps to get better edge flow. Especially for flat circular shapes.

Example

Here is an example. I just apply Retopology modifier, set target to 3000 and just pressed Compute. Auto Edge was on with Smoothing group by default. We got something . But, the topology doesn’t look that great, especially the center circle.

So, I went back to the center boolean operand and give some Cap segments. You can see it makes better edge flow on the big one circular ngon.

Or, you can just add Subdivide modifier. I usually use “Adaptive” option with default. You can see the edge flow is a lot better for both center circular area and front flat face.

Let6’s see one more example. For this kinds of source object, you must Subdivide.

The Retopology result looks good. But, it has an issue. It created the infamous spirals.  I fixed with by increasing Regularize to 1.0. Again this option doesn’t guarantee to remove all spirals. But, certainly worth to try.

CAD Data

Source Preparation

I guess I don’t need to explain how bad models from CAD can be. You all already know. The new algorithms in Subdivide modifier certainly does great jobs for making more Reform friendly faces. But, the mesh has split edges and inverted normal and overlapped double faces what not. Reform nor Subdivide will fail. Until we have T-1000 to retopo, you still gotta do what you gotta do. Here are some notes on mesh preparation.

  • Weld split edges and unwelded vertex. Reform would now know if that’s real edge boundary you want to keep or just bad meshed. The easiest way to check this is applying Relax or TurboSmooth. You will be able to see split edge easily. Then, you could apply Vertex Weld modifier with Threshold 0.001 to fix it.
  • 3dsMax 2021.3 provide Mesh Cleaner modifier. Try that. It also fix some issues.
  • Check if normal is flipped between neighboring faces. Unify option in Normal modifier could help.
  • Delete very small random elements with only few polygons especially for scanned data.
  • Sometimes Quadrify modifier fixes bad topology since it rebuilds meshes. You can also try TurboSmooth with iteration 0.

Tips

  • If it is small part, you can just treat like booleaned model, But, if it has complicated shape, evaluate how much minimum target is needed with Auto Edge OFF.
    If the target is too low, Reform often cause “IPOPT maximum iterations exceeded” error” which means basically Reform saying “I can’t solve this.”. By turning off Auto Edge, you can quickly check how much target is needed.
  • When you Auto Edge, you need enough information within the auto edge boundaries. If you don’t have enough information, again you will meet “IPOPT maximum iterations exceeded” error”. To increase the information, there are 2 options.  1) Subdivide more 2) Remove auto edge condition. For example, if you use UV seams, you could stitch unnecessary seams. If you use Smoothing group, you can smooth some minor edges.
  • Check if your hard edge is coming from the smoothing group or explicit normal. If you only have explicit normals for hard edges and turning on only smoothing group means you don’t get any hard edges. If you are lazy like me,. you can just use Angle option instead of Smoothing Group or Specified Nornal option.
  • Sometimes model could have bad smoothing group and that prevent Subdivide modifier to work properly. Use Smooth modifier to clean up smoothing group.
  • Since Retopology doesn’t preserve mesh data yet. It will look all smooth after it solves. Apply Smooth or Weighted Normal to check hard edges.
  • Often CAD data has nice UV seams, utilize it.

Example

This is a part from Fusion 360 sample scene. It had a unique problem. So, I thought that it was good example to show how I processed the model. You don’t have to go through like this for every model!

This is the source model.
The First attempt with Specified Normal. I got solve. but, I don’t like the edge flow.
I applied Subdivide modifier and set to Adaptive. OK.. something is wrong. I still see a lot of thin edges. This is because there are many smoothing groups there.
I cleaned smoothing group. Subdivide look better.
Retopoed again. Better edge flow. But, I want to improve.
Subdivided more and set Regularize to 1.0.

Then, I was thinking how about go lower res model and TurboSmooth?

This is 2000 target.
Chamfer and TurboSmooth!

OK, I shared all things I have learned during beta testing. If you think it is helpful. Please visit renderStacks!

Also don’t forget to check Autodesk Learning Channel Retopology Tutorial.

https://www.youtube.com/watch?v=sKEu2Gs3G_U
https://www.youtube.com/watch?v=HhUMdy-0kSI
https://www.youtube.com/watch?v=AUikqN_lVPc

 

3dsMax 2021.3 Retopology Modifier Quick Start – Part.1

The new Reform algorithm in the new Retopology modifier in 3dsMax 2021.3 is a definitely one of the best automatic retopology tech on the market. But, this is not driven by crazy AI nor a silver bullet to solve everything with a click. You need a different approach for a different case to get the best result in short amount of time. This is a collected notes from my beta testing period. I hope you find it useful.

Scanned Data

OK. This is easy one. For any organic models, just 2 things.

  • Turn off Auto Edge. This is for preserving sharp edges for hard surface model.
  • Decimate with ProOptimizer A LOT. I mean really a lot. Usually the rule of thumb is matching ProOptimizer verts count to Target count gives you best result in the shortest amount of time.So, if you want to get 40,000 poly mesh, ProOptimized to 40,000 verts first the Compute. Think this way. if your target is 30,000 poly from 2 million poly source. You will not get all the details of 2 million in anyway. There is no reason to feed all those noise data to Reform.
  • If you want to retopologize to really high poly count to reserve all scanned details and Retopology doesn’t solve with that mesh, try InstantMesh mode as a pre-process instead of ProOptimizer. You can’t decimate as much as ProOptimizer with it. But, it generates more Reform friendly mesh. Therefore, it will give you a higher chance to get result.

Tips

  • If you want to process even faster? Then, apply Relax modifier before ProOptimize. You could get faster result in exchange of the loss of details.
  • After ProOptimize if you have very big flat polygon. Remove it or subdivide a little. This kinds of big single polygon can make Deform fail. I’ll show you in the following example.

Example

This is scanned model from Konrad O?óg, www.aunar3d.com. Thanks for the model. It has 1.95 million verts and 3.9 million tris. Look at that beautiful wireframe on right. If you just apply Retopology on this and press Compute. It will takes days.

I applied ProOptimizer and went down to 2%, 39012 verts. As you can see from the shaded view. ProOptimizer does great job for reducing poly count while keeping shape intact.

Then, I had a hiccup. This big lowres place at the bottom was throwing a wrench. I could subdivide this. But, I simply delete it. You don’t see anyway. Also I can recap later.

I turn off Auto Edge and set Target Face Count to 40,000. After 100 second. I got this with 43,000 poly.

The following images are high resolution retopology example using InstantMesh as a pre-process. I pre-processed to 500,000 poly with Instant Mesh and Reformed it to 150,000. It took 20 min on Ryzen 2700X.

Original scan – 1.95 million verts / 3.9 million tri
InstantMesh – 475k verts / 494k quad
Reform – 163k verts(1/11 of original) / 162k quad

Do you want to make your render life 1000% easier! Click here!

Also don’t forget to check Autodesk Learning Channel Retopology Tutorial.

https://www.youtube.com/watch?v=sKEu2Gs3G_U
https://www.youtube.com/watch?v=HhUMdy-0kSI
https://www.youtube.com/watch?v=AUikqN_lVPc

3dsMax 2021.3 Retopology Tutorials Video Collection

Max’s New Remesher is INSANE!

Simple Trick for Perfect Retopology in Max

Introduction to Retopology Tools for 3ds Max®: Retopologizing CAD datal

Introduction to Retopology Tools for 3ds Max®: Retopologizing a Booleaned Model

Introduction to Retopology Tools for 3ds Max®: Retopologizing a Scanned Mesh

Retopology in 3ds Max. Tips & Tricks

3ds Max Retopology

3ds Max Retopology from Jose M. Elizardo

Boolean Mesh Retopoly pitfalls

Miro Retopo

Gladiator Hulk Retopo

3D Studio MAX 2021 Retopology Tools – Adán Martín

Now time to check renderStacks!

3dsMax 2021.3 New Retopology Modifier Test Gallery

3dsMax 2021.3 has been released. The biggest addition of this update is the brand new Retopology modifier. I’ll have another post for the collection of showcase and tutorial videos.

It comes with 3 algorithms to choose, Reform, InstantMesh and QuadriFlow. Reform is the internally developed Autodesk’s own retopology engine.

I have had a chance to beta test while is was developed. This post is the collection of images that I have created while beta testing. I tried my best to test many different types of sources includes 3D scanned model, ZBrush sculpting, CAD import, booleaned meshes and more. Enjoy!

Make sure click image to see big to see wireframe better. Under the image I also tried to post the original source of model as much as remember.

ZBrush Sculpt

296k , 408k

201,881 Poly
Original model 1.2 million poly
Close up
60k, 210k, 2.8mil

732k / 86k / 32k / 20k / 8.6k vets

Do you like new Retopology modifier? renderStacks is as good as this for rendering! Click here to learn!

Scanned Model

https://sketchfab.com/3d-models/lowe-von-asparn-57a57a99ce1f4e45adee5ae37a91f51b
100mil / 300k/ 100k verts
857k / 513k / 116f faces

 

1.5 mil vs 220k https://www.artec3d.com/

CAD Import

Boolean

Up Resolution

One more chance!  Click here to learn about renderStacks. It will change your rendering life!

 

52,464 / 106,302 / 246,787 / 394,237 https://gumroad.com/l/xAQxj

OSL mini tutorial #3 – utilizing scene data and some Math

Welcome to my 3rd OSL tutorial! In this tutorial, we well learn how to query scene/object data and utilize it with MATH! Yes, you heard it right. MATH! I know you always have been regretted that you didn’t pay attention to the math class when you were in middle school. But, never late than never. Re-learning some simple math will make your life easier. WE CAN DO IT TOGETHER!

Like always, we will not write a single line of code in this tutorial. We will use SlateME as our OSL editor. Let me say it again, YOU DON’T NEED TO KNOW HOW TO CODE TO USE OSL IN 3dsMax.

I’ll use MeetMat2 for this tutorial. You can download from Substance website.

First, let’s see how we can query the position of pixel in the scene and utilize. For example, we can make a transition of 2 maps between certain heights from the ground.

You can use “Named Coord Space” map to get a position of a coordinate space.Let’s make one and s some basic setup for the tutorial.

  • Make “Named Coord Space” map and a Standard material.
  • Make Self-Illumination 100.
  • Connect UVW of “Named Coord Space” to the Diffuse Color of Standard material.
  • Make sure to turn on Show Realistic Material in Viewport.
  • Select “High Quality” mode in the viewport.
  • Apply the Standard material to Mat.

3dsMax OSL has an amazing OSL > HLSL auto conversion features as I posted before. You can see OSL map exactly same as render in viewport for most cases. All OSL map has a indicator at the bottom to show if this map could be displayed in viewport. To utilize this feature, your material must set to Show Realistic Material in Viewport, and your viewport must set to Advanced Rendering mode which High Quality preset has.

Your viewport should like this if you follow me correctly. What you are seeing is the World coordinate position as color. If you know what is World coordinate and Object coordinate, you can jump to the next section.

World position is the position from the world origin. Since we plug X, Y, Z, into R, G, B. You can see more Red color along X. Green along Y, Blue along Z. Color can only display from 0-1, that’s why you can only see a little gradient around an axis. Mat’s size is 8.2×1.0x9.4. If value is less than 0, it will be all black. If you rotate the model, you can see the color is not moving with object. Because the coordinate is fixed in world.

Another coordinate you might use is “Object” which is based on each object’s local coordinate. The origin will be at object’s pivot point. The axis will use object’s local axis. This means when the object is moving or rotating, the value will move with objects. If you need to make a map that is stick to the object, this is coordinate you need to use.

Now you know what World/Object position is and how to get the value with “Named Coord Space” map. Let’s utilize the value we got. We will try to blend 2 check map along the height(Z-axis)

  • Make a Maps > OSL > Math Vector > Component (Vector ).
  • Connect UVW of Named Coord Space to Input of Component (Vector)
  • Make a Maps > OSL > Math Float> Range/Remapper.
  • Connect Z of Named Coord Space to Input Value of Range/Remapper
  • Connect Out of Range/Remapper to Diffuse Color of the Standard material.

This should be what it looks like. BTW, I turned off AO. What’s happening here. We took only Z axis value with Component (Vector) map. This map is you can separate each channel from a vector or assemble a vector from 3 floats. Then, we fed the Z value to Range/Remapper which doesn’t do anything with default values. You can see the gradient goes from 0 to height 1. Again, as a color we can only visualize 0-1. I put 1 unit height box as reference.

Now we need to manipulate this value so the value can go from 0.0 – 1.0 between height 1.5 – 3.5. That’s what Range/Remapper  does. Click the map and set Input Range Start to 1.5, Input Range End to 3.5. Now this map takes World Z position as Input Value. You can see “M” button shows that the value is coming from the connection, Then, map the input value 1.5 – 3.5 as 0.0 – 1.0 as output.  You can visually see the gradient is moved up and 2x wider.

We can utilize this value as the Mix value for Mix map.Mix map is a map that Mix 2 color. Surprise! I could use Composite Map, too. But, this map is simpler. Also this is a tutorial. You gotta something new.

  • Make a Maps > OSL > Math Color > Mix(Color) map.
  • Make 2 OSL checker map with different colors and Size 0.05.
  • Connect each Checker map as A and B of Mix(Color) map.
  • Connect Out of Range/Remapper to Mix of Mix(Color) map.

Now let’s make it a little bit more complicated. What if I want to have blue check only top of Mat’s head like snow on his head. We can utilize normal for that.

You can get the normal data with Normal map. Duh. It is under Scene Attribute. It has one option, Coordspace. It should be “World”. Normal is “normal is an object such as a line, ray, or vector that is perpendicular to a given object.” according to Wiki. You can thin think as an arrow that coming out of a face. OK, that’s cool. But, so what? How can it help me?

Usually you need two sidekicks to utilize the Normal data, “Dot product” and another vector. Wha… WTH is “Dot poduct”? My head is already hurting!!! If you really want to know what it is. You can suffer from reading this. Butm I have a good news for ya. You don’t actually need to know what it is. We just need to know how to use this.

  • Make a Maps > OSL > Math Vector > Dot product (vector).
  • Make a Maps > OSL > Values > Vector Value.
    Put 1.0 as Z value. Make sure X, Y are 0.0
  • Make a Maps > OSL > Scene Attribute > Normal.
  • Connect Out of Normal to A of Dot product (vector).
  • Connect Out of Vector Value to B of Dot product (vector).
  • Connect Out of  Dot product (vector) to the Diffuse Color of Standard material.

What did we just do? It looks like face becomes whiter if it face more to the top. When you dot product 3 vectors, Normal and [0, 0, 1] for us. The more 2 vectors look the same direction, The result becomes closer to 1.0. If two vectors are aligned exactly and toward same( direction. the dot product becomes 1.0. If two vectors are at right angle(90 degree), the dot product becomes 0.0. If two vectors are looking at the exact opposite direction. the dot product becomes -1.0. That’s all you need to know. This is how Falloff map works under the hood.

just for the test’s sake, change the vector Z value to -1.0. As you expected, it gets whiter as the point more face down.

How about X = 1.0 and Y, X =0.0?

Got it? Then, Let’s set back to [0, 0, 1].

Now we need some house cleaning. When you dealing with normals and dot product. It is always a good idea to normalize the incoming vectors like this. this makes the incoming vector as a unit vector. If you don’t want to know what/why. just memorize and do it. It is good for you. Normal map is at Maps > OSL > Math Vector > Normalize (vector).

Another item for house cleaning is Clamp. As I mentioned above, dot product generates value from -1.0 to 1.0. You can not see the negative value in render or viewport since both only shows between 0.0 – 1.0. But, if you use negative value for other operation, it could cause issues, therefore. it is always a good idea to cut negative values with Clamp map. Clamp map limits any value outside of Min and Max value as Min and Max value. The default is 0.0 and 1.0. So, any value less than 0.0 will become 0.0. Any value bigger than 1.0 will become 1.0. The map is in Maps > OSL > Math Float > Clamp.

OK. Now we have 2 map trees. One for blending by height. Another one for the direction. We want to combine both so we can have blue check only at the top of Mat’s head. For this kinds of case, we can simply multiply two masks.

  • Select Range/Remapper. Set Input Range Start to 3.0, Input Range End to 4.0.
    This should move mas above Mat’s head.
  • Make a Maps > OSL > Math Float > Multiply map
  • Connect Out of Range/Remapper to A of Multiply.
  • Connect Out of Clamp to B of Multiply.

I know… after all those node, what you got is not that cool. But, this is how you learn.

In this tutorial…

  • we learned how to get position and normal information from the scene
  • how to utilize normal with dot product
  • many of frequently used important math maps such as Range/Remapper, Clamp, Normalize, Multiply. Component.

BUT! Yes, there is always BUT!

The portion that we used to make a mask by face normal exist as one map, Falloff map. This map is basically same as the map tree we set up with a bunch of maps. It take cares Normalize and Clamp, it also have option to map ti the different range. It also allow to define each end as color which is same as Remapping the result with Gradient.

In Falloff map, you have coordinate to choose just like Normal map. You have Face and Away color for each end. Face means the color when dot product is 1.o. Away is the color when dot product is 0 because Type is Perpendicular/Parallel. If you switch to Toward/Away. The Color will map between dot product 1.0 to -1.0.

Thanks!

Do you like my OSL mini tutorial series? Then click here and check out renderStacks, too!

3dsMax tips #4 – My rig is stuck at the previous animation range!

This post is from the recent discussion on Stack Facebook group

The original question was…

has someone experienced that a rotation script controller gets broken/stops calculating properly when it was created with the timerange set e.g. 0-100f and afterwards timeline gets extended to let’s say 0-500f and you start animating with autokey the affected objects, which have the script controller?

I had the experience, too. This could happen in all procedural controllers like Script, Noise controller or Expression controller. What is the solution? One of the most Sr. 3dsMax developer Larry Minton chimed in and gave the answer.

When max creates procedural controllers, by default the controller range is set to be ignored. The setting on whether this is done is controlled by the following 3dsmax.ini setting:

[AnimationPreferences]
IgnoreControllerRange = 1

This setting is exposed to maxscript via: maxops.overrideControllerRangeDefault

And is in the Preferences dialog in the Animation tab in the Controller Defaults group.

Apparently when these controllers were created this option was off. Or this is an extremely old file, this option went into max back in 2005.

You can turn this override back on for these controllers by saying:
c = getclassinstances rotation_script
enableORTs c false

This is the settiing. It is on by default and should be ON.

If you want to make this to be on. You can run this code as a startup script.

maxops.overrideControllerRangeDefault = true

If you already have finished the rig and even animated it. Then, you can use this code to fix for a class of controller. This code is for rotation script controller. If you want to reset all Noise position controller. Swap rotation_script to noise_position.

c = getclassinstances rotation_script
enableORTs c false

If you also change from TrackView for each controller, too. Set to Ignore Animation Range. Here is 3dsMax help file link.