Tagged 'General Scripting'

MCG Spline Material IDs always zero ?

Im working on my first MCG and want to mess around with the Spline MatIDs.
The returned array contains all zero, but they are not !
I set the spline segments MatIDs to 1 and 2 by hand.

Am i doing something wrong ?

Delete render elements which start with "mk_"

I've been trying to find a way to delete render elements with a certain suffix in the elementname, in my case "mk_" but I cannot seem to find any resources that describe how to do this. There are plenty of resources on adding or deleting all elements but not by the elementname or a ceratin string part.

If you can help in any that that would be super appreciated.

Delete render elements which start with "mk_"

I've been trying to find a way to delete render elements with a certain suffix in the elementname, in my case "mk_" but I cannot seem to find any resources that describe how to do this. There are plenty of resources on adding or deleting all elements but not by the elementname or a ceratin string part.

If you can help in any that that would be super appreciated.

how to handle number values with high decimal place count

Hey guys, I have values with up to 8 decimal places e.g. 292.77321149
and I want to dump them into a text file

----------------
example:

a = 292.77321149
newTxtFilePath = "C:\\Users\\marku\\Desktop\\tmp_output_2.txt"
newTxtFile = createFile newTxtFilePath
format "%\n" a to:newTxtFile

----------------
result in textfile:
292.773

----------------
how can I get exact value to my textfile?

Thanks!

SME selection Callbacks

Hello, I have a question.

Is there a way to register user selection changes in SME.
For example I have two material nodes in SME view and want to execute some function when selection is changed.

For viewport selection changes I use this:

fn Subscribe = (callbacks.addScript #selectionSetChanged "MyRollout.VPSlection()" id:#VPSelectionID)

I want to do same thing but not in a viewport but in SME editor:

fn Subscribe = (callbacks.addScript #SMEselectionSetChanged "SMESlection()" id:#SMESelectionID)
fn UnSubscribe =( callbacks.removeScripts id:#SMESelectionID)

how to handle number values with high decimal place count

double entry - please delete

Fix Old Material Library (anoying missing mrMaterialAttribs.gup popup message)

mr-msg
This simple function will remove any missing Mental Ray attributes from material and
save it as new library.
m4

fn fixMtlLib mlib_Path: suffix: =
(
	if not doesFileExist mlib_Path then messagebox "This Material Library not exists!" title:"Warrning" beep:off else
	(
		with redraw off
		(

controlling a propeller's rotation speed?

hi. this have been asked many times, but i just don't seem to get the right answer.
here's the deal:
I have a circle spline that works as my control object. it has an attribute holder with custom attributes on it, a spinner, that will control my propeller's rotation speed.
then i have a point helper, positioned in the rotation axis, wich is this point helper's zero euler Z axis. then my rotor blade objects attached to the point helper, wich doesnt matter right now.

Load custom layers from text file

Hello everyone,

Anyone have script for load custom layers from text file
thanks

Camera from 2d pan Zoom

Is there a script to create a camera from perspective while in 2D pan zoom mode (lets say 70% zoom ) in one of the viewport?
Or is there a script to save viewport while in 2D Pan zoom mode?
also is there a script to hide the viewport label on upper left corner of the viewport?
Thanks.

Syndicate content