Notifications
Clear all

[Closed] 3ds Max Python with splice of .NET

Here is a small example for you guys. Python + .NET + 3ds Max.
Hope you like it!

http://www.ycdivfx.com/3ds-max-python-with-splice-of-net/

6 Replies

Hi

Thanks to share such a things.

I’m using Max 2016 But couldn’t use the file that you made. Consider my little understanding about python i couldn’t use the ViewportCloneForm.py file.

I downloaded the file MaxPythonNetSample-master.zip and copy the folder into max folder as you’ve shown in the video i drag the ViewportCloneForm.py but nothing happen.

Should i copy the MaxPythonNetSample-master folder in a scpecific location or should i install sth prehand or …

I would be greateful to light me up

.

Hi ScriptLover, we developed some nice Python extensions that allow to drag’n’drop Python scripts the same way we do with MAXScript. But if you see in the git repository, we also added a .ms file. Just drag that file and everything should work.

Cheers,
Daniel

Thanks for the reply

In the page that Kameleon adressed it has two adresses i just download the first one and unpack in the max directory.

First i right click on the Max shortcut-- properties--- open file location then paste the folder ( MaxPythonNetSample-master ) there. Then when i drag and drop ViewportCloneForm.ms it turns ( Unable to convert: [100,0,0] to type:String  ) I copy the content paste in Maxscript editer then run it turns  
-- Error occurred in anonymous codeblock; filename: ; position: 71; line: 1
    -- Runtime error: File not found
---////////////////////////////   Edit

In the video you’ve provided in ViewportClone folder there are 7 files and 2 folders but the files which i download at the same folder just 3 files and a folder

.

Ok, from the error, the .py is not found. So lets see the steps for running this.
The .zip you got is the correct one. You can unpack to whatever folder you want.
Next, go the src\ViewportClone folder, and check if you have all of this:
|-libs
|-ViewportClone.pyproj
|-ViewportCloneForm.ms
|-ViewportCloneForm.py

And then just running “ViewportCloneForm.ms” should work.

I added a download link with all the files need for the demo in the article.

Cheers,

Thanks Danielit it works now. it seems it missed two pdb files whch you add now

One question

In one of my tools I’m using BitmapImage to show a rendered frame of selected viewport is it possible to use your tool that way , i mean use this on a rollout or a window

Again thanks for sharing

Cheers

This was more to show the .NET and Python interop.
But, since we are using the DWM .NET wrapper, it should be doable. Although, this a hack, since we are using the Live thumbnails of Windows (Vista+), and they don’t “exist” as a normal bitmap, what we are doing is defining a region on the Form to be drawn by DWM, and don’t let the Form handle any drawing of that area, and in Maxscript you can’t directly override the WndProc of the Rollout to disable painting of that area.
One way around, would be creating a .NET Control that handles this for mxs and use that instead in the mxs Rollout.

PS: For any of this to work, windows must be in Aero style, or there will be no Live Thumbnails.

Hope that it makes sense :).

Cheers