Notifications
Clear all

[Closed] How can i do this ? and this ?

You will need to register a NodePreDelete callback and evaluate the type of node been deleted. If you are interested in said node, you will need to update your details.

Shane

And like I said, you need to register a preNodeCallback to detect when a node is deleted.

If the node is a camera or light, you need to update the apprioprate data list.

May I suggest you take a quick look at the docs (look for callbacks | general event) and READ. It will tell you EVERYTHING you need to know about how to accomplish what you want! Forgive me, I’ve pulled my back out and my patience is at 0.

I think you may find you might have some issues with the dropdown items array, but it would be wroth running a few tests to see if you can delete items from that array, look up “array methods | deleteietem()”

You may also be interested in look at the NodeCreated callback event to detect when new items are created

Shane

1 Reply
(@rappybmx)
Joined: 11 months ago

Posts: 0

sorry if i pissed you off, and thank you for trying to help me
i tried to do what u said bet i got some errors so i thought for an alternative… i don’t know if it’s good but it works and it’s easy

i created a timer i set it to tick every 5second’ and when it thicks it will update my dropdownlist :D… will this slow down my max ?

No need to appologise…I have a lot of empathy of people with cronic pain issues…you simply can’t focus on anything and everything makes you cranky (although my wife would argue that’s my normal state ;))

As for the timer, yes I would imagin it would put quite a drag onto your resources over time…

I’m curious as to what issues you had with the callback system, I know you need to play with it very nicely or it can get very upset, but generally it has worked really well for me, doing what you want…

Shane

soo i’m back, i have 2 new questions/problems

  1. in my script i don’t want to make for all the buttons a macroscript, even if i would like i don’t think that i could do that, anyway… i wan’t to have just to macros…one to open up the script and the second one to store my last action… like if i press a button in the script then i run the second macro it will do what i did previously…( i click me poly button in my scrip window (makes the obj editable poly) then i select another obj and i want to make this also and editable poly, but if i have the second macro (that’s assigned to a shortcut) i hit the shortcut key and it will make it editable poly :)…

so my question is how can i make that :|…

and something that i don’t know is how can i press a button from my script from another script ( in my case from the second macro)

RappaTools.theZone.subModeling.poly < this is the button… how can i pressed it ???

format “
RappaTools % Loaded
” rt_version
rt_version = “v313.1”
where rt_version is the version… ok so this works it will print this in my maxscript listener…

but how ca i do that with

displayTempPrompt “u have RappaTools !rt_version!” 100000000

or with print or…

how can i call rt_version ?

thanks in advanced

hmm…

soo since nobody replied i guess there’s no way to press a button from a script… :((

1 Reply
(@rustyknight)
Joined: 11 months ago

Posts: 0

Well, actually, you have any number of choices, all of which are well document in the docs and have been exampled here on the forum.

You’re first choice is the most direct and looks something like this

[rollout].[button].pressed()

I lifted this straight from the docs, look under rollout | event handlers.

The second is a little more complicated and troublesome. But basically you’ll want to look at the DialogMonitorOPS and UIAccessor functionality.

Shane

thanks RustyKnight, thanks for helping me

i tried to do that but without the () at the end :)…anyway…thanks

so know that i know that… i wan’t to make the second macro :)…
what i have in my mind right now is to:
create a file that will store the last button
when I click a button it my script it will save the line that will click that button in that file
and the second macro will execute what is in that file
or i could do it kinda the same but with a little more script: same idea second file will store just the name of that button that was pressed, the macro will get that name… and i will write for every name what to do… but i think this way is alot more “harder”…
or i could save the last clicked button in the script ini that way i don’t have to make another file :)… i’m going to try to make that second macro and i will let u know if i succeed…if not i will ask for help :)…

another thing i’m trying to make auto update for the script :)… i found a easy way on the internet(google)… here: http://www.stigatle.net/blog/?p=21
downloaded that tut…etc…
but i can’t make it to work…

     d = openFile "[ http://www.313designstudio.com/rappatools/version.dat ]( http://www.313designstudio.com/rappatools/version.dat )"
     id2 = readValue d -- reads the value, saves value in "id2"
     close d --closes the fie

the problem is that it won’t open the file on the website !!! an if you check http://www.313designstudio.com/rappatools/version.dat you will see that it works… how do i have to type the link to the files that are on the web ???

thanks in advanced

i made the second macro… uses the ini :)…
but ! now i have to add a line to all the buttons that i want to be used in macro2…
something like:
setIniSetting theIniFile “Macro” “last” “RappaTools.theZone.subModeling.poly.pressed()”
…works great… Problem…yea, why not !.. i have some buttons ( most of then ) that have some function with the ctrl pressed or shift or ctrl+shift… and my question is how can i pressed a button with shift or ctrl or both by script tried the help, couldn’t find anything

I would suggest that it can’t be done via maxscript as far as I know. You’d physically have to seed a “keydown” and “keyup” event into the system and maxscript simply is not made to do this. DotNet MIGHT.

d = openFile “ http://www.313designstudio.com/rappatools/version.dat
id2 = readValue d – reads the value, saves value in “id2”
close d –closes the fie

Two things come to mind. The openFile function is most likely using an OS level “file” operation, which probably means it has no idea how to handle a http request. I had thought you might be able to use a “file://” request, but I doubt very much if that would work either, these functions simply are not meant to work with internet protocols, which is kind of a shame, cause that would lead to mean cool ideas.

If you REALLY want to read the file from the web, you’d need to look towards something like dotNet, which I’m sure would have the means to read a stream of data from an URL, but this is adding a lot more complexity then you really need.

Try downloading the file to a local location.

Shane

if you could point out how can i download something via maxscript would be grate :)… thanks again Shane


 try (
 (dotNetObject "System.Net.WebClient").downloadFile "[ http://www.313designstudio.com/rappatools/version.dat ]( http://www.313designstudio.com/rappatools/version.dat )" "c:\\somedir\\somefile.ext"
 )
 catch (
 -- some error ocurred
 )
 
Page 2 / 6