[Closed] CGTALK MAXSCRIPT CHALLENGE – Topics and Suggestions
Excellent suggestion Raytracer. I will try this script. Looks very handy !
Hi Marcelo,
I did not quite understand why do u need a separate mesh per frame in the first place ? You could lower the fps and modify per frame the poses of a single object, so you will have a “stop motion” effect.
That , unless I missed something on the way.
Hi gabby. Good point, your method will work in many situations for sure.
The intent was to have a way to have a tool to assembly an animation of models that could have a very different topology using frame-by-frame. One of the reasons for that is the UVMap. Using just deformers over the SAME object the Textures will stretch and it will breaks the “realism” of Clay textures. Using many models i can freely adjust the UVMaps for each model/frame to have it done right.
For instance… Imagine a single plane that needs to transform on a clay car, that divide itself onto 2 clay spheres and then the 2 merge together and became a clay cube then they explode like clay drops and merge again…
Doing Clay animations with crazy topology transformations like that could be (it is) a nightmare to try doing everything with just modifiers over a single mesh. The simple solution is to use many models, that changes along the animation from a frame to another. But doing all the Hide-Unhide keys is something that could be solved with a script like the Morph modifier where we could put a list of models in a specific order and the script just create the hide/unhide keys.
It's a very specific case, i know. ;)
Well, here’s another idea – it is a good and simple possibility to create 2 macro-scripts
“$.visibility = 0” (or “for o in Selection do o.visibility = 0)
And
“$.visibility = 1” (or “for o in Selection do o.visibility = 1)
And assign a short keys for them. it will be super fast, and u can manage it on the viewport with no sluggish performance.
As for creating a list like the morph, well it may take bit more time for it, and it is a very case specific request.
Thnks for the sugestion. I will try. Maybe i will try to make something, with UI and the list any day. I am not a former scripter, but i can code a bit. lol
Tks again ! :)
Any chance we can get this restarted? Seems like theres been any number of cool ideas in the past that haven’t been seen through.
-Michael
mak4max
I am in need of a script or batch processor.
What I need done is relatively simple, and at the moment looks like something that will be handed over to an intern.
We have apx 200gig of Max files on a system from the max 4 era. We’d like to archive them.
(even though possibly 20% are redundant saves)
As you might imagine, I , nor anyone else wants to go through the files one by one and load them up in max and hit a button to archive
them. And then load the next file, and the next etc etc.
Anyone know of a manner of doing this without having to spend a week in front of a terminal ?
We are hoping to compress the files with the texture files intact. 99% of the textures should still exist on the system. I comment on
this because I am not certain if a batch file might get a hitch in it’s giddy-up when it encounters a file where the source textures cannot
be located. (perhaps it just zips and dis-regards this and when the file is opened in the future it gives the browse to locate missing
textures dialogue. ?)
I’m pretty confident that you script gurus and code-a-holics might have a solution.
Your help would be greatly appreciated.
my platform is like
WIndows7 ultimate 64 bit
Core I7 ( 8 CPUs )
12 GB RAM
3ds Max 2011 64bit/vray 1.5 sp5
thank in advance , Cao.
Lets kickstart the challenges by taking a stab at some Boids. Suprising as it may seem I have yet to see a published fully implemented system in maxscript. For that matter I haven’t seen one do everything in pflow either.
http://en.wikipedia.org/wiki/Boids
http://www.red3d.com/cwr/boids/
Care to add some predators?
It would be cool to see an object collision avoidance scheme built in as well .
-Michael
heres a simple find the target script to kick it off
----------------------------------------------------
--Test Move To Target
--A simple testbed for having a point chase a target
--Michael Spaw 02092013
----------------------------------------------------
delete objects
testCircle =circle radius:5 wirecolor:red
testTarget = point wirecolor:green
numTargets = 4 --sets the number of positions the target will be set to
BoundingArea = 200
HalfBound = BoundingArea*0.5
aqua = (color 87 224 198)--Create a color to be used for the bounding shape
currentpos = testCircle.pos
timeStart = animationrange.start
timeEnd = animationrange.end
totalframes = timeEnd-timeStart
----------------------------------------------------
--Heres the bounding area
Rectangle length:BoundingArea width:BoundingArea pos:[0,0,0] wirecolor:aqua --a nice bounding rectangle for neatness
----------------------------------------------------
--set some positions for the target
set animate on
sliderTime = timeStart
timeDivis = (1.0/numTargets)*totalframes
for i = 1 to numTargets do
(
newTarget = [(random -HalfBound HalfBound),(random -HalfBound HalfBound),0]
newtime = i*timeDivis
sliderTime = newtime
testTarget.pos = newTarget
print newtime
print newTarget
)
set animate off
----------------------------------------------------
-- gives the vector to the target with a magnitude
fn moveToTarget currentPos targetPos moveRate=
(
moveVector = targetPos - currentpos
newpos = moveVector*moveRate
return newpos
)
set animate on
for i = timeStart to timeEnd do
(
targetPos = testTarget.pos
sliderTime = i
currentpos += moveToTarget currentpos targetPos 0.05
testCircle.pos = currentpos
)
set animate off
Hi all. How to change the encoding in the read text from a byte?
This function has bit.intAsChar, there seems to be a problem, the necessary encoding of characters in GBK2312
fn ReadFixedString bstream fixedLen=
(
local str = “”
for i = 1 to fixedLen do
(
local ch = ReadByte bstream #unsigned
str += bit.intAsChar ch
if ch == 0 then
(
– Ignore junk
SkipBytes bstream (fixedLen – i)
exit
)
)
str
)
Or there is another solutions? I need to read from a file 256 bytes text encoding GBK2312
Thank