dotNet + MXS

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

REPLY TO THREAD
 
Thread Tools Search this Thread Display Modes
  10 October 2007
dotNet + MXS

In light of David Mackenzie's excellent Python+MXS thread, I figured it would make sense to have a thread focused on dotNet as well. Admittedly this is mainly because i'm interested in using it right now, but any and all techniques about dotNet can be discussed here!

In addition, don't forget the beautiful piece of work that is Bobo's ongoing work with the Maxscript dotNet Resource page.
__________________
"There Really is No Secret"
Martin Brennand - mocha Product Manager - Imagineer Systems
 
  10 October 2007
dotNet + MXS = MXS++
With the addition of dotNet in MAXScript, you can now develop powerful tools that you never thought possible!

dotNet bridge in MAXScript is very useful to access .Net classes:
- .Net forms controls
- file access
- XML read/write
- GDI+
- DirectX Managed classes (video and audio)
- OS informations
- etc.

You can also create your own .Net classes and use them in script. This can be used to share components with your asset and workflow applications for example. Think also interop between your 3D applications (Maya wit Python, XSI with C# and 3ds Max with dotNet can now share components and communicate more easily).

I've recently released a small Avi Player developed in MAXScript and dotNet : http://ypuechweb.free.fr/avi_player.html. It uses DirectX Managed classes (video and audio) and a HScrollBar control (very useful because there's no equivalent in MAXScript).
I also began the translation to dotNet and GDI+ of the "How To ... Develop a Bitmap Painting Tool In Nine Easy Steps". GDI+ is powerful but sometimes (very) slow.
I'll release this doc and others (about XML access, some .Net forms controls and managed classes creation and use in script) in a couple of days/weeks .

One of the limitation of the dotNet bridge is the impossibility to create and use managed arrays in MAXScript (corrected in Max 2008?).
__________________

Last edited by ypuech : 10 October 2007 at 08:41 AM.
 
  10 October 2007
I'll see what I can constribute as well as I have been using dotNet for the project I have been working on and have been using treeView, ListView, calanders, XML and others to get the job done. dotNet is far better then what we had with active X.
__________________
Paul Neale
http://paulneale.com
 
  10 October 2007
This is a timely thread. Can it please be made sticky?

I have an issue finaly that I can't resolve with a simple dotNetControl "system.windows.forms.textBox"

Some of the properties are not working as they should. The ones that I'm having issues with are acceptsTab and acceptsReturn, neither are having any affect on the control. multiLine has worked and I have also added scrollbars.

Any one used this before and have a solution?
__________________
Paul Neale
http://paulneale.com
 
  10 October 2007
I would suggest to call Focus() on the TextBox. I had such problems with a RichTextBox control (other solution, useful to format and colour the text) and resolved them by calling Focus().
If it's a multiline TextBox make sure the Multiline property is set to true.
__________________
 
  10 October 2007
ypuech, can you explain to me what managed arrays are?
__________________
Paul Neale
http://paulneale.com
 
  10 October 2007
Originally Posted by PEN: ypuech, can you explain to me what managed arrays are?

Managed arrays are the arrays from .Net framework. In MAXScript you can't handle them. For example:

local Array = dotNetObject "System.Windows.Forms.TreeNode[]" 5
 -- With a previously defined TreeNode object
 Array.Add Node -- Not possible to call Add method
__________________

Last edited by ypuech : 10 October 2007 at 03:44 PM.
 
  10 October 2007
Originally Posted by PEN: This is a timely thread. Can it please be made sticky?


No worries. I actually thought I already had!
__________________
"There Really is No Secret"
Martin Brennand - mocha Product Manager - Imagineer Systems
 
  10 October 2007
One thing i've been focusing on is the use of message boxes and all their meanings. Although I can call a messagebox with a simple text call via:

message = dotNetClass "System.Windows.Forms.MessageBox"
message.Show "Test"

I can't work out the call of the buttons. Do I need to have a separate object call to define the button properties in .Show? I think i'm getting the syntax confused.
__________________
"There Really is No Secret"
Martin Brennand - mocha Product Manager - Imagineer Systems
 
  10 October 2007
Originally Posted by erilaz: In light of David Mackenzie's excellent Python+MXS thread, I figured it would make sense to have a thread focused on dotNet as well. Admittedly this is mainly because i'm interested in using it right now, but any and all techniques about dotNet can be discussed here!

In addition, don't forget the beautiful piece of work that is Bobo's ongoing work with the Maxscript dotNet Resource page.



I don't no that I would say excellent! but ill take any complements I can get so thanks Martin. I am very excited about the this thread as I am using dotnet more and more in my scripts and am sure I will have lots of questions...

Moving on DotNet, I have some trouble creating a SQL connection in MXS. I have been trying to use System.Data.Odbc but have had no luck Im sure there is something simple i have to do to get this to work but I'm having a mental blank!

I am presuming that it should be some thing like db = dotNetClass "System.Data.Odbc"
but all I get is undefined... Any help would very much appreciated!


Cheers
Dave
 
  10 October 2007
Originally Posted by specxor: Moving on DotNet, I have some trouble creating a SQL connection in MXS. I have been trying to use System.Data.Odbc but have had no luck Im sure there is something simple i have to do to get this to work but I'm having a mental blank!

I am presuming that it should be some thing like db = dotNetClass "System.Data.Odbc"
but all I get is undefined... Any help would very much appreciated!


Cheers
Dave

System.Data.Odbc is a namespace name, not a class name.

I've not much experience with Database usage but I looked at the MSDN documentation and found some examples.

Here is one:
connectionString = "Driver={SQL Native Client};Server=(local);Trusted_Connection=Yes;Data  base=AdventureWorks;"

connection = dotNetObject "System.Data.Odbc.OdbcConnection" connectionString
connection.Open()


You can have a look at :
the namespace documentation : http://msdn2.microsoft.com/en-us/li....data.odbc.aspx
this tutorial : http://www.functionx.com/vbnet/odbc/paradox.htm
__________________
 
  01 January 2011
WPF and maxscript

Hello maxscripters,
if you are interested in WPF in maxscript I'm starting my blog here.
WPF under maxscript looks very promising
 
  01 January 2011
Originally Posted by maxscriptlaborer: Hello maxscripters,
if you are interested in WPF in maxscript I'm starting my blog here.
WPF under maxscript looks very promising


I also have a blog with some Max/WPF information. It's definitely the way to go for making tools in Max now. WPF is a great addition to MaxScript when it comes to making custom tools, and I look forward to see what you come up with. Thanks for sharing.
__________________
Website
Blog
 
  02 February 2011
I have same problems as Track when using Graveys script, I still need to restart max to make it understand the assembly has changed. Or did we understand wrong how the script should work?
 
  02 February 2011
Originally Posted by AnoPrkl: I have same problems as Track when using Graveys script, I still need to restart max to make it understand the assembly has changed. Or did we understand wrong how the script should work?
As I stated in my previous post, I was never able to successfully get a dll to load/unload dynamically. The variables/class names etc in the code provided in that post may be deceptively named dynamicDll but it does not do what you want. It was posted as a solution to loading a dotnet dll from a network. I have not worked on dynamic loading/unloading since sometime before that post.

One idea I didn't try was to increment the version number of the dll(s) to be loaded with each build. I vaguely remember reading something about this somewhere on the internet... I have no idea if it will work or not but it's an idea if you want to look into it.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:44 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.