Tagged 'General Scripting'

Weld and Smooth

Hi All,

I found this script for Weld and Smooth and for some reason it does not work with 3DS max 2014. I get an error "--Unable to covert:"" to type: controller"

If anyone can take a look at it and get it to work properly it would be greatly appreciated.

Thanks!

--Weld and Smooth--- Nicholas O'Leary www.nicholasoleary.com
macroScript WeldAndSmooth category:"Nood" tooltip:"weldAndSmooth" icon:#("standard", 1)
(
rollout WeldAndSmooth "WeldAndSmooth" width:225 height:194
(

select geometry with any kind of mesh

I exhausted all possibilities after one day I'm out of ideas how to solve it, here is my problem:

I have to count all polygones in selection so I have to get to every object with mesh and here is a problem.
I noticed 3dsmax geometrysuperclass is also particle systems, mr proxy and other objects which have no mesh.
I can't define it by class because there is so many classes to predict.
So I created filter to exclude particle systems at least but it seems no matter what I do PF_Source stay always in selection.

geting bones from skin modifier

So I want to get all bones from a skin modifier, something like this:

getBones skin

unfortunatelly there is no such function in max, at least haven´t found it. The solution with geting the names of every bone and than searching for the nod with the same name is useless, as names are not uniq and there are defenetly more than 1 node with the same name. So any solution for the problem?

press OK btn after copying an object with SHIFT

Is it possible to press ok in script when copying with shift automatically?

fn handleBox =
(
local windowHandle = DialogMonitorOPS.GetWindowHandle()
if (windowHandle != 0) then
(
local title = UIAccessor.GetWindowText WindowHandle
format "\tWindow Title: %\n" title to:f_error
format "\tWindow Body:\n" to:f_error
local children = UIAccessor.getChildWindows windowHandle
for child in children do
(
format "\t\t%\n" (UIAccessor.getWindowText child) to:f_error
)
--local error = UIAccessor.GetWindowDllDescription WindowHandle
UIAccessor.PressDefaultButton()
true
)

Unable to convert: [] to type: Float

Hi, I'm really new to 3DSMax scripting and I have a real beginner question. My problem is that I can't figure out how to convert a value into a Float. In my example I created a 2 lines ms script:

x = [0.5,0.5,0.5]
x as Float

That's all.
When running the script 3DSMax shows the following message error:

--Unable to convert [0.5,0.5,0.5] to type: Float

Does anyone have an idea what I'm doing wrong?

Many thanks in advance,

Ewok

Rig GUI question

Hello everyone, I'm currently working on a GUI for a rig that I'm building and am having some trouble getting a rollout in a floating dialog box to update with the changing of a custom attribute. Below is an example of my current setup, but I'd like to be able to set the rollout: and ui: of the Custom Attributes to the floatingGUI_rollout spinners, or achieve a similar result so that I can animate the custom attributes and have the GUI update to display the correct values.

Forced "Select object" mode

Hi!

Is there a way to switch by a script such a state when, for example, while being in "Select and move" mode with selected object, next I pick another object and the mode is automatically changing to just "Select object"?

It is extremely usefull to have such a state switcher because often when you are in "Select and move" with a selected object and pick another object it also by default in "Select and move" mode and as a result some accidental undesirable shifts of object may happen.

Materials Adding

I'm trying to add to my rollout an option for the user to add a material of there choice to the selected object.
Whenever i try to do it, it wont convert the image so it will work on the box.

My code is:

button openbox "Add Material"
on openbox pressed do
(
myMap = getOpenFileName \
caption:"Open A Test File:" \
filename:"c:"

myMap = uvwMap mapType:4
addmodifier selection myMap
m = myMap

selection.material = m
)

Getting a spinner value to change a value in a script.

Hi guys.

I'd like to know how to use the value of a spinner to change something in a script.

So when a user changes a spinner value, that vale is used to adjut the settings of the rest of the script when a button is pressed.

It's for my Multi/Sub-Object script and i'd like a spinner so that the user can select how many sub materials they want. I've got the spinner in the UI, i just can't figure out how to take the spinner value and put it into the property for the number of materials.......It seems simple but everything i've tried doesn't work.

Cheers.

Changing the Area to render via a script.

Hi all i have the following code

 

<code>

try(DestroyDialog SB_Tools_Region_Render)catch()

Rollout SB_Tools_Region_Render "Render Region"

(

   dropdownlist render_dd "Please select a render type" items:#("View", "Selected", "Region", "Crop", "Blowup")

on render_dd selected i do

setRenderType render_dd.items[i]

 

)

CreateDialog SB_Tools_Region_Render

<code\>