ScriptSpot

MCG

MCG Path Constraint a.k.a IncrCloneOnCurve

By vusta · 2015-08-05

Version
2.01
Version requirement
2016
Other software required
SP2, version 1.06 simply requires Max 2017
Date updated
2016-08-31
Votes
12
Downloads

Tags: MCG Path Constraint Incremental Clone on Curve

Description

This MCG constraints your object motion to a path. The motion can be repeated forever beyond the curve.

It can also be used to incrementally clone object along a curve and there is no need to adjust the distance

between the clones and count when length of curve changes.

 

Ver 1.01.00: You can now use a curve to control scaling of the clones.

Ver 1.02.00: updated due to SP2 catering for multi curves in a spline. However this will still work only on the 1st curve in a spline. I have not updated multicurves functionality yet.

I strongly advise you to get SP2 as this provides a great speed boost to MCG....and extra stuff, of course.

ver 1.04.00: now supports multi curves in a single spline. Also added Rotation control curve for Cloning, and Fake movement to utilise Scale/Rotation curves in PathConstraint mode.

Ver 1.05: added Pivot Gap option...WARNING: becareful with low gap values....ie. there will be shitloads of clones for gap approaching 0, I've actually put minimum at 1 for safety reasons.

Ver 1.06: updated for Max 2017 to fix Spline/Path related flaw (please continue to use 1.05 for Max2016)

Ver 2.00: This version will work for both 2016 and 2017. Please note for 2017, you'll get deprecated messages, it's OK, it will still compile and run.

Ver 2.01: you can now rotate your path freely

Any small donations to vusta@hotmail.com would be greatly appreciated. I intend to then fully donate onto the following:

http://www.worldanimalprotection.org/

https://www.worldwildlife.org/

http://www.redcross.org.au/

http://www.savethechildren.org.au/

Thankyou. Meow. Woof. Moooo. Oink. Grrrl.....Bzzzz...

Videos
Comments (40)

+ Path Deform ?

Tokamak · 2021-06-03

Nice script/MCG!
Is it possible to add a Path Deform to you mcg?
On the green spline, your MCG with two meshs cloned,
on the red spline one mesh with Path Deform:

Attachments

Mesh disappears

cptSwing · 2018-12-10

Once I pick an Editable Spline as path, my mesh just disappears and has no more faces. I delete the MCG, I see it again.

I'm on Max 2018.4, Windows 7 64 bit, if it helps?

Do not work, 3dsmax2017.1

IMax · 2017-10-13

I used you wonderful modificator a lot , but after re-instalation of 3dsmax 2017.1 it does nothing, i mean it just do not modify geometry after apply the modificator and choose spline !
I tried 2.01 and 2.00 - same result
What could be the problem?
Thnx

works fine for me...

vusta · 2017-10-13

if you can't provide pictures, error messages, sample file...then I can't help.

I can't remotely fix an invisible problem.

fzxj520 · 2020-03-07

Thank you very much.
Error report as shown in the figure
Please see Annex.

Attachments

Escalator

fanaeean · 2017-08-13

Great script!

It is also best to use the new parameters in the "Rotation" to build the escalator

Great script!

OccultArt · 2016-11-26

Its a great script but a few extra features would make it even better, something along the lines of Zbrush IMM maybe?:

- Twist along spline setting (alternative to using an extra spline)
- Auto weld (for creating hozes/Tubes)
- Start and End Caps

Something like this:
http://polycount.com/discussion/comment/2488661#Comment_2488661 =

rgby · 2016-11-01

edit: deleted/backedup my compounds folder and now it works. thanks!

ver 2.01

vusta · 2016-08-31

you can now rotate your path freely. Pls note the latest video is for Stitches...but it does exactly the same thing.

updated to ver 2.00

vusta · 2016-05-11

to support both 2016 and 2017

HarryPotter · 2016-04-28

We can't go to Max2017 here...
Too many stations and renderfarm PCs to go through atm...
Thanks for all your efforts tho...
Appreciate all the help...

Thanks again...
Cheers...

ok last try...

vusta · 2016-04-30

but some background info...read this...and you'll see that it's possibly related to UUID (a unique identifier like fingerprint)

https://www.facebook.com/groups/1611269852441897/search/?query=UUID

So I've given some modded compounds new IDs where I think are needed.
I would again, temporarily backup the compounds in:

C:\Users\xxx\Autodesk\3ds Max 2016\Max Creation Graph\Compounds

to some other drive, then empty them out, then reinstall this new mcg with new UUIDs...and pray hard....really really hard...

PS: all the 'dupe' messages you see, as long as the compound is already found in:
C:\Program Files\Autodesk\3ds Max 2016\MaxCreationGraph\Compounds

you can safely remove them, permanently, from:
C:\Users\xxx\Autodesk\3ds Max 2016\Max Creation Graph\Compounds

Attachments

HarryPotter · 2016-04-19

Temporary emptied both Compounds and Tools folders, reinstalled the MCG Patch Constrained and still didn't work. Attached the screen from when Evaluate the graph...

Attachments

I'm stumped...everything looks perfect.

vusta · 2016-04-19

can I blame win 10 ?

Can anyone confirm if this works on Win 10 ?

HarryPotter · 2016-04-21

Sorry for the late reply...
All the stations i tried are using the latest Win7 64bit...

HarryPotter · 2016-04-21

I'm getting this when opening Max inside the Listener:
"Compound with duplicate name * found but not registered"
where * put the following:

AppendIf
Boxify
CacheValueUntilControlChanged
ClampIntMax
ClampToBox
FaceIndexBufferIndices
FaceIndices
IfArrayNonEmpty
IfGreaterThanZero
IfGtEqZ
IsNullFix
NormalizeFromBoundingBox
OneMinus
ScaleFloat
Third
TransformPoints
VectorFromArray

And also these three:

Compound with duplicate name 'LtZ' found but not registered: C:\Users\Gregory\Autodesk\3ds Max 2016\Max Creation Graph\Compounds\LtZ.maxcompound

Compound with duplicate name 'LtZ' found but not registered: C:\Users\Gregory\Autodesk\3ds Max 2016\Max Creation Graph\Tools\Downloads\Vu_PathConstraint\Compounds\LtZ.maxcompound

Compound with duplicate name 'LtZ' found but not registered: C:\Users\Gregory\Autodesk\3ds Max 2016\Max Creation Graph\Tools\Downloads\Vu_PathConstraint\Compounds\LtZ.maxcompound

And also the following entries:

Unable to create compound LimitedPush: Could not find compound file RayTraceLimitRayToIntersection

Compiling Max Creation Graph tool C:\Users\Gregory\Autodesk\3ds Max 2016\Max Creation Graph\Tools\AEcho.maxtool ...

Compilation failed: Validation failed for C:\Users\Gregory\Autodesk\3ds Max 2016\Max Creation Graph\Tools\AEcho.maxtool : Compiler error occurred while building expression for node 18:IsNullFix->18:IsNull. Cannot build a concrete type, there are generic parameters in the type arguments: U.

Maybe these help ?
Thanks...

spurious..

vusta · 2016-04-22

you can ignore most of these because they're all duplicates...eg. for a common compound like PlusOne.....just about every MCG package has it..and when you install the package it goes under the \Downloads\blah blah\compounds....so there are a bazzilion copies of these PlusOne compounds lying around (also one in C:\Program Files\Autodesk\3ds Max 2016\MaxCreationGraph\Compounds which is the original)

The critical one is the IsNullFix, it affects a bunch of MapChannel related MCGs, I've screamed my lungs out to Autodesk for ages about this now (I even posted a fix on my FB page https://www.facebook.com/vustarama but to no effect so I won't bother with it anymore, I know how to fix it and that's all that matters). But this error doesn't affect the PathConstraint

Now if you said you've emptied out the 2 default directories and then reinstalled PathConstraint and it still didn't work...then I must admit I'm at my wits end...all compiled messages were perfect.

I'm about to upload the new version for max2017 (which they screwed up everything Spline/Path related) so maybe wait for that and try that ?

EDIT: ok I've uploaded 1.06 for Max2017, assuming you have it (or trial version)...so I'll assume you don't have any other previous MCG installed for Max 2017...this MUST work !!! (pray)

Doesn't work here...

HarryPotter · 2016-04-18

Using 3dsMax 2016 EXT2 SP3...
Tried it on three PCs so far and it worked only on one of them...
On the other two it does nothing at all...
Any installation help would be much appreciated...

I'm attaching a screen with two grabs; one from the installation result and the other from the tool, that runs but doesn't seem to do anything, in case this helps...

Thanks...

Attachments

another screenprint...

vusta · 2016-04-19

could you please go into Scripting>Max Creation Graph Editor>open up Vu_PathConstraint.maxtool, Build>Evaluate and let me see any messages there ?

I would say most likely there is some compounds in

C:\Users\UserXYZ\Autodesk\3ds Max 2016\Max Creation Graph\Compounds

that is overriding the PathConstraint compounds. Quickest test for this is to MOVE OUT all compounds above into some backup folder (put it outside of C:\Users\UserXYZ\Autodesk\3ds Max 2016\Max Creation Graph), reinstall PathConstraint and that should work.

update ver 1.05

vusta · 2016-02-17

added Pivot Gap option...

V.1.04 issue

Seiku · 2016-02-16

Hi! I started using MCG a few days ago, I was going through hell building a clone-on-a-path thingy when I saw yours - same basic idea, I even could recognize some nodes, but waaaaay more complete~
Anyway, I tried to use it (V.1.04, I've got SP2) but i can't seem to make it work -- The mesh I use won't get onto the path no matter what...
The graphic is way more complicated than my current level, maybe you have any idea of what could be going wrong...?

Attachments

Percent is 0

vusta · 2016-02-16

because you are currently in Clone Percent mode but your Percent is at 0...so there are no clones...even if you have a small value in there it might be below the threshold of 1 clone so you don't see any. So just put in 50%, then play around with it...

If you were in Clone Count mode, you would see 12 according to your setting...

Should work this time...:)

Gap between pivots points?

Seiku · 2016-02-16

Ah, sorry, I should have shown a better screen -- No, I actually played with every single value without ever seeing any change. I think there's something wrong with applying the path to the mesh, since it doesn't even place the actual mesh onto the curve (That's what I did with mine, I don't know if yours keep the original mesh untouched or moves or hides it...)

EDIT--After some research I maybe pinned the problem down, but I still haven't the solution; the MaxScript Listener returns many errors...
From what I saw on Autodesk forums and the MCG Facebook Page, this would mean that the compounds used by the scrips are in conflict with their homonyms in Max default folder.

EDIT--After further researcg again, I had to manually delete every compoint pointed out by the listener, then relaunch Max and voilà! The script worked.

EDIT--So, now I have another issue... I thought the gap between clones would be calculated between their pivot points, not the actual gap between the meshes. Would there be a way to change that by modifying the graph...?

Attachments

compound conflicts

vusta · 2016-02-16

yeah I'm not too happy with packaging an MCG properly, ppl install it...then compounds are overridden with same name compounds in another directory...what is the point of 'packaging' then...I've raised this issue but there's only so much I can do.

The gap is between the BBox of the instances ...so they would fit snuggly end to end...

Note that you can make the gap NEGATIVE, so adjust this to your liking..

Default Zero value

Seiku · 2016-02-17

I'm trying to find a way that would make easier for architects to use it; i.e. to place panels along a path, and it'd be much more practical to set the gap between the center of the objects. I'm still trying to modify it though, I'll see if I can come up with something...

easy peasy lemon squeezy..

vusta · 2016-02-17

I'll upload it soon....

updated to 1.04

vusta · 2015-12-15

to support multi curves

Ver 1.02.00: updated due to SP2

vusta · 2015-12-07

updated due to SP2 catering for multi curves in a spline. However this will still work only on the 1st curve in a spline. I have not updated multicurves functionality yet.

k2000 · 2015-10-12

Error occurred in Vu_PathConstraint defined in C:\Users\user\Autodesk\3ds Max 2016\Max Creation Graph\Tools\Downloads\Vu_PathConstraint.maxtool
- ViperEngine.ViperNullArgumentException, Parameter #0 named 'n' of operator ShapeFromNode cannot be null at Autodesk.Max.MaxPlus.ShapeObject ShapeFromNode(Autodesk.Max.MaxPlus.INode)
at Viper3dsMaxBridge.ViperMaxOperators.NodeOps.ShapeFromNode(INode n)
at _anonymous_type_21.{105}lambda_method(Closure , Single x0, Int32 x1) in C:\Users\user\Autodesk\3ds Max 2016\Max Creation Graph\Tools\Downloads\Vu_PathConstraint.txt:line 307
at ViperEngine.ViperPrimitiveOps.ControlFlowOps.Repeat[T](T init, Int32 n, Func`3 body)
at _anonymous_type_21.main(InstanceState state, Boolean UseScaleCurve, TriMesh mesh, Int32 AlignAxis, Boolean Flip, Single RotY, Single RotX, Single RotZ, INode PickPath, Single Gap, INode PickScaleCurve, Single ScaleMult, Boolean Reverse, Boolean PathPercent, Single OffsetPerc, Single Offset, Boolean OutOfRange, Matrix modifierTransform, Boolean Percentage, Single Perc, Int32 Count) in C:\Users\user\Autodesk\3ds Max 2016\Max Creation Graph\Tools\Downloads\Vu_PathConstraint.txt:line 290

path issue

vusta · 2015-10-12

have you modified something in:

C:\Users\xxx\Autodesk\3ds Max 2016\Max Creation Graph\Compounds ?

because this is overriding my compounds when the graph is evaluated. This is a
path issue which I have no control of. A quick test is to rename

C:\Users\xxx\Autodesk\3ds Max 2016\Max Creation Graph\Compounds to some dummy name, reinstall my mcg and it should work

k2000 · 2015-10-12

test scene - same issue
no clones
I can see only 2 boxes in one spot, increasing number makes no sense

path_constraint_test_max2016_sp1_ext1.max - Autodesk 3ds Max 2016

k2000 · 2015-10-12

cannot get it worked (((
nothing happens, clones never show up
maxscript listener gives errors

Untitled - Autodesk 3ds Max 2016

vbn · 2015-10-03

Hmm... I have Nitrous enabled so I'm not sure what causes the slowdown. I'm also not running any other processes or documents in parallel with Max.

I will test it on a couple of other PC with Max and will let you know the results.

win10 ?

vusta · 2015-10-03

what about win10, I'm on win7, I hear win10 is not officially supported (for max2016 that is) yet.

Also, my mcg install is local ie. on my c:\blah blah....yours is not on some network location I assume (still, I don't really see a problem there tho)

seems OK

vusta · 2015-10-02

after various tests, I'm getting about 150-200FPS, the odd occasions I see 70FPS.

Then I pushed the clones up to 100, did some more tests and still getting about 150FPS.

My system has a 4770K, 16Gb ram so it's less than yours...but this file is tiny so I think machine spec is not the problem. Dunno what it is...your machine was not stressed out by other processes right ?

Update:
What about graphics driver? I use Nitrous and was getting 150-200FPS,
I switched to default legacy direct3D and I got about 10FPS !!!

Problem with MCG

vbn · 2015-10-01

Very useful, thanks. I just installed the MCG (version 1.01.00) to try it out and it works but unfortunately it is really slow for me. When I start adjusting any parameter of the MCG modifier, the viewport updates very slowly and FPS drops dramatically (~5-10 FPS). I tried it with a box which is not a heavy object. My PC is i7 4930k, GTX 980 4GB, 32 GB RAM. Do you know what might be the cause?

Thanks in advance!

is it possible for you to send the Max file ?

vusta · 2015-10-02

only then I would have a better idea...

I did a simple test with teapots, way more 'complicated' than a box and I get ~200FPS..lowest was about 60FPS and my machine is less powerful than yours...

added GetCurveLength compound

vusta · 2015-08-27

I've converted the Get Curve Length logic into a compound so ppl can use it more easily...does not require EXT1.