General questioin about mixing python and maxscript

General questioin about mixing python and maxscript

Anonymous
Not applicable
880 Views
2 Replies
Message 1 of 3

General questioin about mixing python and maxscript

Anonymous
Not applicable

Hello,

I have some subroutines that where written in C and I have some python wrappers that supposedly would make

those work in python. Does that mean those C subroutines will work in a max script  if I use python in max script  editor?

 

and question 2.

can you mix python and maxsript? like, if I take a returned value from python can I then use that in maxscript code and go back and forth?

I hope this makes sense. I am trying to figure out a work flow for how I can use C, python and maxscript in one script in max.  (I am newby when it comes to python and the concept of wrappers) Any ideas?

 

I currently have a project where first half is done in C because I had to use certain C written subroutines, and second half of project is done in maxscript. I am trying to merge the two in maxscript using python wrappers and wondering if thats possible.

 

 

Thanks

 

 

 

0 Likes
881 Views
2 Replies
Replies (2)
Message 2 of 3

malcomarmstrong
Advocate
Advocate

I regularly mix python and maxscript. Some core code is Maxscript, but the ui is Python (pySide or Pyqt4), sometimes I use python list comprehension for data sets and then acces max functionality with the python lists. Definitely can be done.

 

As for the c routines, I dont see why they would not work, we have tools that mix maxscript, dotNet, Python, xml and others.

 

Without knowing the exact code, there may be clashes I have not considered.

 

Hope this helps

0 Likes
Message 3 of 3

mois_moshev
Explorer
Explorer

This page of the documentation explains how you can import a python module in maxscript.

Simple datatypes are copied directly between the two runtimes, and more complex types are marshalled - e.g. python dict to maxscript struct, etc.

This seems to be a sane approach for mixing them. I'm just about to start using it.

0 Likes