Tagged 'General Scripting'

How to use C# to get the parameters of the Tiles procedural texture?

How to use C# to get the parameters of the Tiles procedural texture?

case "Tiles":
 
     Debug.Print($"======{texType}======");
 
     Debug.Print($"{tex.ClassName(false)} has {tex.NumParamBlocks} params");
 
 

print message:

======Tiles======
Tiles has 0 params

Distance along the Z axis from the selected object

Hello everyone! I don't understand scripts. Please help me make a script if it's not difficult: so that it interactively shows the distance along the Z axis from the selected object (help point) to the selected vertex (editable poly). This used to work with Working Pivot, but now it doesn't work at the subobject level.

MapButton with a jpg file as image

EASY QUESTION . it's such a simple question that in a day of testing I couldn't solve it and not even chatgpt can help me. and looking at the max online guide I'm pretty sure that not even autodesk knows how to do it).
I would like to make a button with a jpg, simple. no strange stuff, script pages.

what's wrong with this line of code?

mapButton 'btn1' "MapButton" width:75 height:90 pos:[20,10] map:@"G:\\XXX\SCRIPT_interfaccia\SCRIPT_Library\Immagini_Tessere\STANDARD\KKK\file_0001.jpg"

grazie
love for everyone

How do switch between pivot selection per hotkey?

Hi,
in 3ds max i have 3 modes to switch the pivot selection.

Pivot Point Center
Use Selection Center
Use Transform Coordinate center

for faster work, i will switch it per hotkey. But in the Hotkey-Editor i don't find a name like and the max script listener has no print from it.

Has anyone tried to grab this per script or found a Hotkey-Editor name?

regards,
Ulrich

check if node has transform

I would like to check if some node n has transformation, which means

n.transform!=matrix3 1

Just using != doesn´t work, as far I have read it´s only avaible since max 2018 and I need my script to work with older versions of max.

multiple script objects problem

Hi,
I made a little script to "straighten" a spline to have its overall slope.
It works but I want to apply the script to selected splines ( loop ) and then it don't work anymore... Anybody can help ? :-)

BS = selection[1]
BSW = BS.wirecolor
SP = copy BS
select SP
macros.run "Modifier Stack" "Convert_to_Spline"
verts = numKnots SP
NP=SplineShape pos:[0,0,0]
addNewSpline NP
PO = getKnotPoint SP 1 1
addKnot NP 1  #corner #line [0,0,PO.z]
NEWD = 0
for i=1 to (verts-1) do
(
PA = getKnotPoint SP 1 i
PB = getKnotPoint SP 1 (i +1) 
PAF = [PA.x,PA.y,0]

event handler for a custom thumbnails

Hi,

I need help with a dot-net. My frirnd and I are making a custom library image browser using dot-net in max rollout. The thumbnails are showing properly using/loading custom dot-net controls. But we cannot managed to set an event handler when clicking a thumb. we want something like
"on small_dialog clicked sender arg do ()". But the click makes no change

do we need to make an new event and make it public from dot-net? I attached the code and dll as well and a screenshot.

I know partial max-script and he knows moderate dot-net. together we are almost disastrous.

"while not eof f do" but from the second line

Hi,

I would like to read an external file but not from the first line, from the second one.

Is there a simple way ?

Thanks

attach by geometry name

Hi guys can someone kindlt help me do a script that attachs by geometry name?

vertices dot not showing as circle

Hello,

I am running 3DS Max 2009 and I have been struggling with vertices not showing as circles. my system is Windows 11 and VGA is Nivida 2080.
I have tried everything that I can think of but nothing works if I click the show vertices as circles they show but as soon as I move around the screen or move the mouse they disappear. I have tried the compatibility setting and that didn't work.
so please if anyone can help me with this matter that would be great.

see the attached screenshots
1 when I first open max and create the sphere
2. after going to the edit poly