Tagged 'General Scripting'

Help with the trimleft/trimright function

 

I've taken my favourite script and tried to learn from it. It's probably is a bit complicated for a beginner but I really wanted to add a function to trim any leading and trailing whitespace characters and also add an option for Title case and Sentence case. I read the manual and all I can see is:

 ToLower + ToUpper

Is there another way to achieve Title case and Sentence case?

DETECT MAP TYPE - DIFFUSE, BUMP, REFLECT etc

how to find out map type of a texture

for m in bitmaps do

(

print m.?????????

)

 when I use print bitmaps

I get

name1:Bitmap
name2:Bitmap

But I need

DIFFUSE

BUMP

 

Change UI colour when snap / lock is active ?

Just a quick question to you guys, is it possible using Maxscript to change the colors of the UI when snap or lock is active ?

I'm simply looking for a way to give a better indication in the viewports that snap or lock is active.

For example changing the background colour to a different shade.

thanks.

COPY VERTEX ID IN CLIPBOARD.

How to make for copy vertex-ID of several objects with Edit_poly modifer (by Tab forexample)?

copy vertex id

gui help

I want to create a GUI that is basically a ton of buttons with different images, where each button runs a command who's name is based on the names of other scripts i have.

First, I don't know how to house all the buttons on a grid so that there is a scroll bar if need be.

Second, I want the buttons to be created depending on the files in my script folder. Each button will run a script in my script folder.

Vertex Keyframe Trasfer

Friends need help with this script.

This script creates boxes at each vertex of the object pick and trasnfiere keyframes of each vertex to each box set. (eye, the script is not mine, I copy a page of examples)

I need help to make some changes, please:

1-select only the vertices I want to use and save it in an array.
2-create a copy of a selected object in each vertex that is in the array and transfer your keyframes.

rollout A1 "Animated Vertex"
( 
 button B3 "Pick Object"
	on B3 pressed do
(	 
 local boxSize = 1 
 local frameStepping = 2 

File in use!

people! I've got a problem! I use

dotNetControl dropbtn "System.Windows.Forms.Label" pos:[70,4] width:155 height:121
dropbtn.BackgroundImage = (dotNetclass "System.Drawing.image").fromfile (....001.jpg)

and everything is working ok, but when I change the file 001.jpg and try to save it, it sais : cannot save, file in use :(((

how to solve that? It is very important to know!

detect scene texture -- please answer!!!

I've found some ideas here:
http://forums.cgsociety.org/archive/index.php/t-1028393.html :

gc() -- just for this example, to make sure everything is nice and clean
 
-- find the scene root. The rootnode, medit, etc are references off this scene root
sceneroot = (for r in (refs.dependents rootnode) where (classof r == Scene) collect r)[1]
 
-- collect all the assets
origAssets = for i = 1 to AssetManager.GetNumAssets() collect (AssetManager.GetAssetByIndex i)
 
-- for each of the assets...
for AUIO in origAssets do
(
-- dump info on the asset

Select Face Array

Hi,

I need a help in faces...
I'm trying to collect some faces, some faces have an array but I can not load the array in setSelection ...

Thanks in advanced

	prov = $.selectedFaces as integer
-- Unable to convert: #faces(181, 234, 347 : $Editable_Poly:Plane003 @ [32.705963,272.583252,0.000000]) to type: Integer
 
prov
#faces(181, 234, 347 : $Editable_Poly:Plane003 @ [32.705963,272.583252,0.000000])
 
$.EditablePoly.SetSelection #Face #{prov}
-- Unable to convert: #faces(181, 234, 347 : $Editable_Poly:Plane003 @ [32.705963,272.583252,0.000000]) to type: Integer

Sublime Text Editor - MXS support

Hi,

Is there anyone who has looked at opportunities to get support for the MXS to the Sublime Text Editor? (http://www.sublimetext.com/)

I have not investigated this much, but this should probably be able to do?

I see it already is language defenition files to notepad++ here(Notepad++ MXS Language Definition)

Have any of you tips, tricks and suggestions around this they would have been received with great thanks.