Tagged 'General Scripting'

How to make a script “batch friendly”

Hello fellow members of scriptspot. I use BatchIT by Paul Neale for batch processing max files, I enjoy using it, and highly recommend it. I have a question, as it appears to be an entirely different beast to prepare or format scripts to be used in a batch process. My question, for the most part is this: How would one go about making a script that will search for a given object and then if not found continue the search for the next object, so on and so forth, and then finally delete any of the found objects.

glTF material - change values for all selected materials or default settings

I have 877 materials in a very large file and I'm testing some software that uses glTF materials. According to the documentation, when there is no texture map in the roughness slot it's default value is 0 (mirror-like). If a texture is added it switches to a value of 1. The problem is that using the scene converter sets all the material's roughness to 0, so everything is shiny by default, which is stupid. Is there a way to switch that value to 1 for all selected materials at the same time? Or is there a way to change the default to 1 when converting to glTF instead of 0?

MatchEvaluator

Hi,

Is there a way in MAXScript to use a MatchEvaluator which can be a parameter of the dotnet method Replace (from a dotnetobject/dotnetclass "System.Text.RegularExpressions.Regex")?

Remove QuadMenu items with the MaxScript

There are two Corona items in the QuadMenu permanently - once removed it coming back on next 3ds Max start.

actionMan.executeAction 572340868 "7" -- Chaos Corona: Open Corona Converter
actionMan.executeAction 572340868 "6" -- Chaos Corona: Open Corona Proxy Exporter

Is there any way to have .ms in the scripts/statrup folder to remove both items from the QuadMenu on 3ds Max start?

Make unique object group from multiple Array

Hi All
How to create a unique group of objects from multiple arrays?
This is an example of a known array of layers

 layer1 = #("Sphere001","Sphere002","Sphere003")
 layer2 = #("Box001","Box002","Box003")
 layer3 = #("Tube001","Tube002","Tube003")

then I used the loop method like this with the results I wanted

ObjectGroup= #()
for i=1 to layer1.count do
(
	for x=1 to layer2.count do
	(
		for y=1 to layer3.count do
		(
			groups = #(layer1[i], layer2[x], layer3[y])
			ObjectGroup += #(groups)
		)
	)
)

Unable to convert: BitMap to type TextureMap

Hi all.
How to convert BitMap to type: TextureMap ?

--------------------------------------------------------------------
displaceBitmapStr = getBitmapOpenFileName caption:"Select displace image file" filename:locDir types:"All|*.*|"

renderWidth = displaceBitmap.width
renderHeight = displaceBitmap.height

displaceBitMap = bitmap renderWidth renderHeight filename:displaceBitmapStr

displaceTextureMap = bitmaptexture.displaceBitMap
--------------------------------------------------------------------

TV screen object

Hello.
I need a script that would create a new object, the screen based on the size of the diagonal and the thickness of the frame and depth of the object, the ratio of 16x9 or 16:10. or 4:3.
For example, I enter a diagonal of 55" and a frame of 1cm and a depth of 4cm.
And the script creates a rectangle 1218mm x 685mm, adds 1cm thickness to it and adds 4cm volume.
How can this be done?

Camera rename

Hi all.

I haven’t used Maxscript in my work for a long time, I forgot a lot...
There is a camera in the scene. It is known that the camera class is Freecamera. I want to rename it using a script.

But that doesn't happen

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
for v in geometry do (
if (classof v == Freecamera) then
(
select v
$.name = "Camera"
)
)
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

I need a really easy custom 3DS Max script written for me, can anyone help?

I need a script written and I'm looking for some help from you experts out there (I'm sure it'll take you guys literally seconds to write this one :) ).

Here's the design;

a) I have around 100 folders, and in each folder there a varying number of splines between 2 and 10 I'd say in each one.

b) I have a Master_Spline that's to be used as the master path for sweeping each those splines that are in each of those 100 Folders.

Here's what I want the script to do.

Small script, works in 3ds 2012 to 2020 but error in 2024

Hi,

this script sample uses custom dot net controls from lonerobot. Whenever mouse is up on the thumbnails the script shows error. Method not found. You have to load attached dll to make it work. Can anybody help me to bypass it, pls. Its shows a method not found errorbox when mouse hovering.

(

rollout HitchHikerRollout "smallbrowser" width:240 height:270
(
dotNetControl 'HitchHiker' "Lonerobot.ui.controls.hitchhiker" pos:[0,0] width:240 height:270
on HitchHikerRollout open do
(

HitchHiker.filetype = (dotNetclass "LoneRobot.UI.Controls.HitchHiker+filetypes").jpg