[Closed] WPF-Max Spinner
After some researches I decided to make some UIs with wpf, completely inside visual studio and load them with assembly. First custom control I want to create was spinner, this is my first c# project also, so I decided to share it with community and get feedback from professionals to debug and upgrade it. All files include assembly,maxscript and sourcecode are attached. Please download-test and it would be great if you tell me any idea you have to improve or optimize it.
How to Install:
Copy “Cut.WPF.dll” to 3dsmax root folder and test it by running “SpinnerTest.ms”.
Dotnet Version: 3.5
Visual Studio 2012
3dsmax assembly used:
ManagedServices.dll
Features:
Min, Max, Scale property like 3dsMax.
Changing value by mouse drag.
Changing value by keyboard arrows.
Changing buttons border to red at keyframes.
Making a two way connection with subAnim.
managing undo.
Right-click to abort dragging.
good job. it’s better than max’s wpf built-in spinner
but this’s not a two-way connection. and it’s not true undo/redo. these two things can be implemented by only using max sdk (Autodesk.Max)
Thank you!,
About connection, Yes it’s just a timer and it’s not a binding or something like that.
About undo, would you please explain a little about 3dsmax undo mechanism, how its work?
and it would be great if you point me to an example of using Autodesk.Max assembly.
I have another questions about integer values:
is that OK if I add integer option to this spinner or I need to create separate control for integer values?
it would be great if you point me to an example of using Autodesk.Max assembly.
could you believe? i want to see any good example of using Autodesk.Max too! Autodesk showed only Teapot creating and Hello, World utility for two years of the dll lifetime.
I have another questions about integer values:
is that OK if I add integer option to this spinner or I need to create separate control for integer values?
the spinner type could be a parameter of control. you don’t need new “integer” spinner.
using of a timer is absolutely ok, but i’m not sure that ‘timer-based’ update should be a part of spinner control. probably it’s better to delegate this update to application(dialog, window) that uses this and another custom controls.
Because they love teapot, they made it in 1975.
Searching VisualTree to find spinners by type or name is also time consuming.it seems heavy process when I compare it to the control timer. but I don’t knew how much, dispatcher timer uses another cpu thread and Actually I don’t knew how I can compare cpu process.
And about undo management, when I use dotnet controls (numericupdown), It’s applied by default, but why in WPF I need to recreate it?
you could check both Nyx Voltron and Nyx DBR , both use and only use Autodesk.Max.dll (plus some of the other managed dlls from 3dsmax) for working with the SDK, no C++ SDK used in the making. Voltron works with nodes and controllers at the SDK level, and DBR works at the renderer control level.
This tools are great, congratulation!. But I don’t know how I can see examples in your source code
Autodesk.Max.dll was added in max 2013, questions is if we use this dll, How we can support versions before 2013?
This tools are great, congratulation!. But I don’t know how I can see examples in your source code
Autodesk.Max.dll was added in max 2013, questions is if we use this dll, How we can support versions before 2013?
That’s a problem, if you want to support older versions (if I recall you do have Autodesk.Max free from ephere for non-comercial use, with support for 2010, 2011, 2012), but you are freed from recompiles, for later versions. Unfortunately or not, the best source for info is the Autodesk.StateSets.dll.
Autodesk.StateSets.dll is available in 2013 and above.
Denis told me you need to manage Undo and connection by using Autodesk.Max. Would you please list some of the very useful class or function(s) inside this two dlls which are not accessible or are faster than maxscipt?
One old source of info. https://www.ephere.com/autodesk/max/docs/
As for the undo part, you need to create class that inherit from Autodesk.Max.Plugins.RestoreObj, and then use that class to store the changes on the GlobalInterface.Instance.TheHold, and you better use a disposable Hold wrapper to avoid leaving the hold broken.
The connection is a bit more complicated, because the .NET part doesn’t allow to receive mxs objects aka IValue’s so it may requires some tricks to make it workable, either using maxscript to get anim handles and navigate the pblocks or may other options. What type of connections would you want?
I just want to create something like “Controller” parameter in the Max’s native spinner.