Tagged 'General Scripting'

DotNet XML usage

Hey guys I got a question about Dotnet and writing out xml files.

Currently I'm writing a script which should export data to a .xml file, which has to follow a certain format to be usable in a game.

I want to recreate the format of "open" in the line (see attachment please) but I have no clue which command I have to use.

I know how to add attributes to an element, but the thing I want to add, should not be an attribute sadly :/

Can someone give me the right direction?

My code so far:

dotNet.loadAssembly "system.xml"

SLICE MODIFY MAXSCRIPT

I have an idea , a script slices object with a distance , my script works well in the first time , but the second time it is not correct , i dont know why , can you help me , thank a lot ----- (sorry , my enlish is not good)

units.SystemType = #millimeters
chieungangx = $.max.x - $.min.x
soluongx = (chieungangx/3000) as integer
for ix = 1 to soluongx do
(
sliceMod = sliceModifier Slice_Type:0
addModifier $ sliceMod
ObjPosx = [$.min.x ,$.center.y,$.center.z]
tempMatrix = ((matrix3 [0,0,1] [0,1,0] [1,0,0] (ObjPosx +[ix*3000,0,0]) ))

Simplify Code

Hi all masters, i need some help here. I need simplify code script from my script, its work fine but i think it can be simplified.

try destroyDialog Rtest catch()
rollout Rtest "Test-Rollout"
(
button bt1 "Load_Material"
button bt2 "Apply"
edittext 'Fdir' "" width:130 height:20 enabled:false
on bt1 pressed do
(
local curpath = Fdir.text
local newPath = getSavePath initialDir:(curpath) caption:"Select the path where your Images are located"
if newPath != undefined then
(
Fdir.enabled = true
Fdir.text = newpath
--HERE START A LARGE CODE--

Add Vray lights to Vray Fog with Array.

Well I'm getting back into scripting and learning as I go. I still need assistance on getting this to work though. I usually have trouble with getting into the deeper part of scripting for Vray.

I have this so far but I don't know how to get array part to work. I tried to add a picture if this helps. All I want is to add a group of selected VRay lights to the VRayEnvironmentFog list and turn off all lights for now. And I could have this written wrong to start with for all I know.

Vat = getAtmospheric 1

Vat.use_all_lights = true

for obj in (selection as array)

[convert] area lights to mesh planes

Hi,

Does anyone have an idea if such a script exists already? What I want is to convert vray plane lights into mesh planes, but keeping the position and dimensions of the original lights.

Many thanks,

calculation vertex position from animation to bind pose

Hi all! I am trying to write a script for 3DS Max, for the extraction of morphs for the skin.
Calculating the skin vertex position is simple:

i-vertid
n-boneid
v =vpos[i]* inverse bonebind[n].transform* boneanim[n].transform* weight[i][n]

but I do not understand how to get the top misunderstood by transformation back from animation in a bind position.

restorevertbindpos=vpos[i]* inverse boneanim[n].transform* bonebind[n].transform* weight[i][n] 

http://i.imgur.com/HIcFpKY.gif

Modefire Cancel function

Hi there.

yellow label :editing Mode.
and
Ash label :modefire Edit mode Ended.

These mode switching function
already has been in 3dsmax?

script newbie trying to work some magic

I'm trying to make a script to automatically align the pivots of selected objects, the align-part I've done but now i want the script to also create groups of each object(to sort of bypass aligning pivot axes to world). Here's what i've got so far:

for i in selection do
	(
		local NAME_IS = i.name 			--should be the name of the selected object
		local GROUP_EH =isGroupHead 	--check if selected object is a group
		if GROUP_EH = true then			--if it is a group
			(
				i.pivot.x = i.center.x			--move pivots of selected group
				i.pivot.y = i.center.y
				i.pivot.z = i.min.z

Reset pivot point for selected objects

Hi guys!

Some time ago I made a simple script to automate the workflow of resetting a pivot point of an object. Simple stuff. Now I wanted to alter the script in such a way that it does the same thing for each consecutive object in my selection. So let's call this script "reset pivot of selection".

The script:

(
activeSelection = selection as Array
for s in activeSelection do
(
macros.run "PolyTools" "CenterPivot"
macros.run "PolyTools" "ResetXForm"

)
)

Well, the script works fine for a couple objects, and executes really fast.

Unique Material ID for polygon for editable mesh for multiple selection.

I've been learning to Maxscript and

I've be trying to create unique material id for polygon faces for editable mesh objects.

I found a code below that's been able to do so by selecting an object.

But somehow I can only do so one selection at a time. My model has 1000 objects.
And I would love to select all and do the below function for each of the objects automatically.

I've been dissecting the code but with no prevail...

Thanks so much for any help at all.

fn setPolygonMtlID obj =
(
local obj = selection[1]
local uniqueFaces = #()

Syndicate content