Tagged 'General Scripting'

How to connect two vertices of a poly ?

I Wonder how to connect two vertices of a poly with maxscript ?
can't find... :-(

rename files

real simple one I cant get to work. renaming a file in external dir.

d = @"C:\Users\user\Documents\3dsMax\previews\"
NewDir = @"D:\test\Test\"
--copy file
for f in getFiles (d + "_scene.avi") do
copyFile f (NewDir + getFilenameFile f + getFilenameType f)
--rename file
Files = (NewDir + "_scene.avi")
renamefile ((getFilenameFile files) ("test.avi"))

basically I want to rename _scene.avi to test.avi.

thanks folks

Finding point

How can I find the two points marked in the image by the green dots?
I know all the other points marked by crosses in the image.

Here is the test code for the scene. I'm a bit stumped on how to go about solving for these position points.

Thanks

delete objects
startPoint = [3.0,5.196,0.0]
endPoint = [0.0,12.0,0.0]
orgPointA = [0,10.5,0]
orgPointB= [0,8,0]
 
point pos:startPoint size:.5 wirecolor:yellow
point pos:endPoint size:.5 wirecolor:yellow
Arc radius:orgPointA.y from:0 to:90 pie:off reverse:off pos:[0,0,0] wirecolor:red

Create line between objects with controller

Hello
I would like to simplify creation of a line between two picked object.
The created line is parented to the first picked object, add a look at targeted to the second picked object, and the line scale is linked to the distance between the two picked objects.
As usual I can do the beginning, but I can't do the end.... If anybody could help :-)

--------------------
obj1 = pickObject()
obj2 = pickObject rubberBand:obj1.pos

obj1n = obj1.name as string
obj2n = obj2.name as string

new_spline = splineShape ()
addNewSpline new_spline

First attempt to automate grab vieport - create still image with all the cameras in the scene

This is my first attempt to write a script that goes through all the cameras in the scene (free and target) and do a grab viewport-create still image.But I am getting errors. I would appreciate any help on this why I am getting errors and what I am doing wrong.
Thanks.

function grabview01 label folder:"d:/" =
(
for c in cameras do
local fname=folder+label+c.name
viewport.setcamera c
img=gw.getViewportDib()
img.filename=fname+".jpg"
save img
)
grabview01 "cam-"

Bend SpaceWrap bug...

Hi there
I'm trying to make a rig FFD with Bend spaceWrap, but in bend spacewrap, angle parameter is not accessible throw maxscript.
With this code:
$bend001.angle.controller = bezier_float()

Must add new bezier float to bend angle controller, but it's not possible.
With macrorecorder it showed like this:
$.bendangle.controller = bezier_float()

Unfortunately this is not working too. It even could not be wire parameter too.

Need help

what I need help to do, because I´m starting to 3dsmax scripting right now.
Well, I need to select a number of objects that it has your own paint effects modifier.
I need to aply If I have for exemple 10 boxes, 2 keys for paint vertex opacity channel
one wiht value 100 and the second with the value 0. And each box must to have as the following the Box1 frames 1 and 5, box2 frames 5 and 10 and ...
Could some one help me with That.
Thanks

iCount = 0
for o in $ do
(
iCount += 5
o.modifiers[#VertexPaint].layerOpacity = 100

real time uv scaler

hello scriptspotters!

im learning scripting by bringing down my own needs as archviz artist into scripting language. so I'm creating tools to ease up everything bla bla bla

I have come to a scenario which outruns my very limited skills in scripting languages:

I want to create a tool which scales uvs through a slider in realtime without going through uv ediot in unwrap uv modifier.

here is my tryout to get it done but clearly im missing something huge

$.modifiers[#unwrap_uvw].unwrap2.ScaleSelectedCenter uvsize.value 0 --uvsize being name of my slider

LOOP SEQUENCE NUMBERS IN MAXSCRIPT

I have an array x = #(1,2,3...,n) . How can i create an array y :

y[1] = x[1]
y[2] = x[1] + x[2]
y[3] = x[1] + x[2] + x[3]
.................
y[n] = x[1] + x[2] + x[3] + .... +x[n]

Can you give me the funtion ? Thank you for your help

chamfer modifier

hello there

is it possible to make a script that enables or disable all chamfer modifiers at once in a scene? this would be very handy, because snapping with it enabled is hard and then you forget to enable it again before rendering...

thanks in advance and best regards
themaxxer

Syndicate content