Tagged 'General Scripting'

How permanently save a text written in an EditText and added in a ListBox?

As written in the title, how permanently save a text written in an EditText and added in a ListBox? (when I reopen the rollout, the text written before is present in the listbox)

Below is my example:

-----------------------------------------------------------------

rollout t "test"
(
	listbox l1 "" items:#()
	edittext ed1 "" 
	button b "Insert Name in ListBox"
	button s "Save Text in Listbox"
 
 
	on b pressed do
	(
		if txt != "" do 
 
(
l1.items = append l1.items (ed1.text as string)
l1.selection = l1.items.count
ed1.text = ""
)
 
)
 
on s pressed do
(

Visual Maxscript and Attibute Editor

Hi all.

I have a problem beacause I'm not a pro in scripting and I need to create a little windows dialog in the Visual MAXScript. In this windows I have a slider and I must to connect this slider with an attribute holder wich control a dummy by a wire parameter. I'm not sure if I'm very clear ^^
So I made a little script but there is a problem and I don't know how to do.
If somebody can help me it will be really fantastic! :)
Thanks!

Here is my wonderfull script:
.
.
.
.

rollout unnamedRollout "Untitled" width:162 height:300
(

convert: undefined to type: String PROBLEM [SOLVED]

OldString = "Arch137" as string -- Change to suit
NewString = "AM137" as string -- Ditto
theMaps = getClassInstances BitmapTexture
for i in 1 to theMaps.count do (
	fileName = theMaps[i].filename
	if matchPattern fileName pattern:"AM*" ignoreCase:false == false then (
		newFilename = trimleft fileName OldString
		new2filename = NewString + newFilename
		theMaps[i].filename = new2Filename -- renames
	)
)

Movement controls visibility

Hi all,

Kredka Strikes Back "Controllers"

I'm back:)
Before I start writing 500 lines of code I have question about controllers to ask.
I search for this in help/net, no idea how to do it.

I have to do 2 operations
1) check for particular controller in objects selection like:
for obj in selection do
check if obj has given controller if yeas add object to list

2) take these objects with particular controllers and remove from them controllers.

It will be few controllers but let say now I'm looking for one particular notetrack.

I can do it like this:
notetracksobjmdq=#()
for s in selection do
(

Combine Two Arrays

Let say we have two array with same items count.

 
arr1 = #("a","b","c","d","e")
arr2 = #(1,2,3,4,5)

Which will be the easy way (sort code) to combine these 2 and get this output

#("a", 1, "b", 2, "c", 3, "d", 4, "e", 5)

Script Speed

I have written a script which will do something like this:

Detach faces applied with material whose name ends with "_alpha" (material name) to new objects, and put those new objects inside a group called "Alpha_blending_mesh". 

some one can test this for me on windows 7 and vista

Hi I want to know if activex treeview and listview work in windows 7 and vista (32 bit)...
please if some can test this code for me it will be great...

code is in attached file these are exemples from max help thanks in advance

Ultra-slow script exit...

I've got a fairly basic script (I can throw it here on demand) - I gather all of the materials in the scene with a specific prefix, confirm their sub-maps are of a specific type (via classof) - and then edit simple flags (visible, etc) - for them.

I added timestamping, and the code itself runs _fast_ - we're only talking a dozen or so simple materials. However right before it ends, it takes 30+ seconds to clear the final function. If I do _all_ of the code _except_ editing a map (I just comment out only the X=Y code) - it runs super fast, exits right away.

key

hi

you have

scripts Sounds for all the buttons 3d max 7

because I do not know how to set the key tone

thx