Notifications
Clear all

[Closed] dotNet UI

Hey Guys,
I’m back in business. I was really busy this past week finishing up some projects and getting things wrapped up.

Feel free to check out one of my latest projects which I was CG Supervisor for.
A Very Harold and Kumar Christmas.

Aside from that. I’ve got a question. Is there an event for right-clicking a button?
I was unable to find anything in http://www.scriptspot.com/bobo/mxs9/dotNet/dotNetObject_System.Windows.Forms.Button.html

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

you have to use MouseDown(MouseUp) event and check MouseEventArgs for button was pressed(released).

I was wondering if anyone has treid to create a dot net control for creating an editable curve for a non linear control. I’m looking to replace reaction manager…

2 Replies
 lo1
(@lo1)
Joined: 11 months ago

Posts: 0

I’ve implemented photoshop-style curves in c#, there’s a thread somewhere here for the source code of vfb+, you can download it from there.

Those are not exactly the type of splines that exist in reaction manager or the maxscript curve control, but that’s just a matter of replacing the mathematics.

 PEN
(@pen)
Joined: 11 months ago

Posts: 0

Funny, I started to write one of those at one time, the concept was working just fine. Don’t forget there is also a built in curve control in Max script that you can use. I wanted to have more control over it and get some specific things working but never ended up using it. Not really all that hard to setup a simple one but when you want to start adding more control points it gets a bit trickier. Have a look at the bezier stuff on my site for some information about it. Might be best to write something like that in C# and just load it but I wonder if the value conversions would get slow. IT might not mater if you store the values that are returned and then just work out the curve in Max Script.

wow! i’m not so tough…

Well maybe not replace it…just looking for a quick way to create a control which uses curves…l=since the drawCurve method creates a curve joining given points, …how can I access the math defintion of that curve so I can read off co-ordinates? It can’t be that hard…

1 Reply
 lo1
(@lo1)
Joined: 11 months ago

Posts: 0

I’ve looked for a way to do that at the time, but the drawcurve method does not expose this information.

yes thnx Io…I’ve got the math and c code somewhere…I was just wondering if there is a method within dotnet to churn out values given the curve…jut trying to save myself work…im lazy that way…

oh ok…just got your last post…if thats the case then, I guess I have to do it myelf… thnx

1 Reply
 PEN
(@pen)
Joined: 11 months ago

Posts: 0

I think that it is the faster solution, see above.

You don’t want Max to have to be constantly converting values to and from dotNet as that will get slow.

The math is simple if you want the non-normalized values of the curve as all you need to get are the XY values at any point along the curve. If you want the normalized value of the curve you need to walk the curve along its length, I worked this out years back but can’t seem to find my code any where. It had something to do with walking along the curve and added up the distances between each point as you go to get the curve length, chop that into segments and use that to find your points. I would have to think harder about it to remember the full process that I did. I also don’t know if it is the only way to do it. Generally you are just looking for the XY values.

 lo1

Once you calculate the curve values in C#, you can give maxscript a dictionary (or for the sake of simplicity, two arrays) of X/Y values at a predetermined resolution. This should eliminate any slowdown.

edit: reading your post again, perhaps this is what you meant in the next sentence, I am not sure.

2 Replies
 PEN
(@pen)
Joined: 11 months ago

Posts: 0

A dictionary might be a good idea as well. I was thinking of just storing the data about the knots and tangents and doing the math with that. A dictionary might speed it up more depending on how course or fine you need the data.

 lo1
(@lo1)
Joined: 11 months ago

Posts: 0

for what I had to do it was ideal, as I was dealing with 8-bit values (colors) in the X and Y. If you are using it for 3d scene positions, I guess you would need a much bigger dictionary, making it a less than ideal solution.

Originally posted by PEN
Funny, I started to write one of those at one time, the concept was working just fine. Don’t forget there is also a built in curve control in Max script that you can use. I wanted to have more control over it and get some specific things working but never ended up using it. Not really all that hard to setup a simple one but when you want to start adding more control points it gets a bit trickier.

Yes I’ve had a look at the curve control…it looks great but can’t seem to get my head around how to instanitate each curve in an array and get point2 values off it once the dialogue is closed…it would be great if I could see some example of it being done.

1 Reply
 PEN
(@pen)
Joined: 11 months ago

Posts: 0

The UI for it is just a UI, you need to store the data your self about the curve and reapply that information when the UI reopens. It really doesn’t do much for you other then give you an interface to see a curve. Personally I would like to see something that we can use in rigs built into Max for this. Well really want I want is a node based rigging system ala Maya so that we can write C++ nodes to handle the hard stuff so that it is fast.

what maya’s rigging system are talking about? as i know maya doesn’t have anything smart of this kind.
hypergraph:connections? connection editor? what is it?

1 Reply
 PEN
(@pen)
Joined: 11 months ago

Posts: 0

Yes is the answer. Maya uses nodes that you connect together using the connection editor or just connecting the tracks in hypershade. There are a couple if I remember right that handle curves.

I’m working on a shot tool and I’d like to create a preview thumbnail for the selected filename.

I have a listbox of images located in a folder and once the user highlights/clicks on one I want to have a preview image show in the dialog.
The preview window itself…should I just use a dotNet Label item and fill the background image property on user click filename?

Just curious to know what the best option out there would be.

1 Reply
 PEN
(@pen)
Joined: 11 months ago

Posts: 0

Label or the pictureBox but I just use labels as it takes less typing and I have never seen a difference in the two.

Page 7 / 18