Notifications
Clear all

[Closed] [Script]Blueprint Tools

Hi folks, i created a little script for all you car modellers out there!

It all came about, due to working in a front viewport last night, and having some troubles with the car images getting in the way. So i thought id give maxscript a go, and this is my first script!

I was having the dilemna of hiding some planes when modelling, and the freeze/unfreeze hide/unhide was getting fairly annoying, so i made a little script, to solve this problem.

 It hides/unhides planes name Front,Back,Top and Side, and also All at once too.
 
 
 Anyways guys, give me some feedback on this - would be much appreciated.
 
 Cheers!
18 Replies

Hi William,

Congratulations on your first script! wasn’t that easy!!

I’ve got a couple of suggestion that may help you to improve it. How about combining your icons into one file, and then making them for both large and small icon views, look for ‘Icon Bitmap Files – Creating’ in the MXS help.

How about making your five buttons macroscripts, then they can be dragged to any toolbar on the interface. Look for ‘macorscript’ in the help index.

When you’re ready to learn a bit more, how about a creation utility for the four panels that you’re controlling.

well done and keep it up < :

Thanks for the suggestions, i was thinking along the same lines!

Maxscript is good stuff!

hi! cool! i wish i had something like this back then while trying to model a car…

my suggestions, maybe you could use a checkbutton instead of a normal button, so if the button is pressed, it means the the plane is visible, and vice-versa.
Just make sure that you do some checking when the rollout is opened by using a handler like this: on BlueHider open do
e.g.


checkbutton hideFront "Hide Front"
 
on hideFront changed state do
(
$front.isHidden = state
)
 

on BlueHider open do
(
if $front == undefined then hideFront.checked = false 
else hideFront.checked = true
)

or, maybe you could also try using some keypressed functions, to check if the user is pressing the control on the keyboard and clicking on a button to… maybe alter its see-through mode?
e.g.


on hideTop pressed do
(
if keyboard.controlpressed then
 (
 $top.xray = not $top.xray
 )
else
 (
 hide $top
 )
)


congrats on your first script!

just my two cents

Awesome ! cheers.

Ill have a look at it later when i get home, although i dont quite understand your code.

for instance, the isHidden attribute, state ??

The maxscript reference is not that good, if you dont know how maxscript works. It could be better IMO.Clearer examples. However, i got there in the end.

Quite pleased with it as it stands, as its helping me already, which was the main thing.

But i will be planning on revising it, as itll only benefit myself and possibly others.

Thanks!

no problem…

as for the isHidden part…

you could try typing this in the listener if you have your $top object in the scene…

$top.ishidden

after pressing enter, you’d get something like this in return

false

the isHidden is a property of an object (or a node)… these are stuff you find when selecting and object and looking for its properties through right+click -> properties…
You can find them in “General Node Properties” in the helpfile

so when the code says “false”
it means that $top is not hidden… it is visible

now if you want it to be visible, you can type:

$top.isHidden = true

true or false are sometimes refered to as booleans in the helpfile

the helpfile is great, it just takes a little getting used to, especially if you no programming background.

as for the samples, i beleieve you could ask here at the forums anytime, i think that people will be more that happy to provide you with samples of a function that is quite hard to understand… well at least its much easier that writing a specific script for someone.

good luck:thumbsup:

Thanks a bunch dude, your a star!

How could i link a slider bar, to control the xray function of a selected object?

The higher the slider the more the transparent it becomes?

left to right opaque to transparent.

Thanks.

I am not sure about slider and the opacity but on the directions given by galagast with the checkButton, you can also change the text displayed on the button when checked or not (in case you would waht to change to text buttons instead of images).

The code would be something like this:

 
rollout testCheckButton "Test The CheckButton"
(
checkbutton myCheckButton "Hide the Objects"
on myCheckButton changed theState do 
(
if theState == true then myCheckButton.text = "Unhide the Objects"
else myCheckButton.text = "Hide the Objects"
)
)
createDialog testCheckButton

Nice script by the way and great for the first one! My first one was about 7 months ago and now on everything I have to do I try to use or create a script for. They help alot!

Keep it up!
Anton

Thanks, i implemented the changes over the weekend. Should post up the new version tomorrow!

Page 1 / 2