Edge Constraint Toggle

Hi guys!

So, I started to make a script that basically shows me on the UI if the edge constraint it ON or OFF on the selected object.

Basically I have it as a button on the UI, and when I have an object selected and I press the button It toggles it and enables Edge constraint to edge and stays lit up. But when I deselect the object the toggle is still on.

Would it be possible for the Toogle button to make the test on the object i select and see if the edge constraint is on and toggle it acordingly.
Obviously if its a group of object it wouldnt do anything, i think.

This is what i have.

macroScript test category:"Tests"
(
	local isOn = false --initialize to false (closed)
 
	on execute do (
		if ( $ != undefined) then (
			if isOn == true then ( --if open, close it
				isOn = false--and lower the flag
				$.constrainType = 0
			) else ( --if closed, open it
				$.constrainType = 1
				isOn = true --and raise the flag
			)
		)
	)
		on isChecked return isOn --return the flag
)

i have both the script as a button and a shortcut, so basically it runs the script on the object and togles the button on or off.

Cheers!
-P

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Haider of Sweden's picture

.

a little off-topic:

@Miauu, By the way, can you give me a link to see how your other idea, about Maya+UV+Max have to works?

a little off-topic, but take a look at this and maybe it makes a little more sense to you what I was talking about before:
http://www.scriptspot.com/3ds-max/scripts/uv-2-mesh#comment-26682

ps. I have still not installed Maya to make a more specific demo for you

Kind regards
Haider
www.haider.se

Haider of Sweden's picture

I use the hotkey shift-x for

I use the hotkey shift-x for Edge Constraint Toggle (Poly).

What exactly does your script do?

Something I would love to see is a HUD notification that tells you when the constraint is turned on,
Can it be done?

Kind regards
Haider
www.haider.se

miauu's picture

.

Yep, it can.

Haider of Sweden's picture

.

How? Show us ;)

Kind regards
Haider
www.haider.se

miauu's picture
Haider of Sweden's picture

.

Sweet!
Finally a way to see directly on the HUD that the constraint might still be on.

Three more suggestions so far:

1- center the HUD instead of left-aligned. Reason is that it will be more visible because the object you work on is centered in the screen.

2- an .ms file to put in the startup folder as a callback function, so that the constraint always shows.

3- Textbox appears/disappears when you select/deselect a poly object.

Kind regards
Haider
www.haider.se

miauu's picture

.

Suggestions 1 and 2 are done. Go to the script page.
What is the reason for suggestion 3? Where this textbox should appears and what it is purpose?

By the way, can you give me a link to see how your other idea, about Maya+UV+Max have to works?

Haider of Sweden's picture

.

About suggestion 3, you might have missed the reply before (in the other thread), but here is a copy-paste

About the third suggestion I mentioned before, I thought that the HUD - what I previously called "text box" - could appear only once it is needed. And it is needed once you have a editable poly or a mesh with an edit poly modifier on it.

You can skip this particular feature from the MCR, because you can disable the HUD with a press on the button. But for the MS file that can be used in the startup folder, it is preferable that the HUD disappears when no poly is selected.

What do you think?

Kind regards
Haider
www.haider.se

Haider of Sweden's picture

.

Thank you very much for your dedication :)

I will get in touch with you soon regarding the Maya+UV+Max idea.
First I must install Maya and then capture a video and send it to you. I think the idea suits your way of producing scripts and solutions - your ideas are often unique and add great improvements to max.

Kind regards
Haider
www.haider.se

miauu's picture

.

Tomorrow. :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.