Page 1 of 1

Error using nxusBookMachine.py in Max

PostPosted: Tue Sep 04, 2012 4:56 am
by GPNMilano
Hey, I'm wondering if it's just me but I'm having some serious issues getting this particular python file to load up with the MaxPlugin.

I'm using Max 7 with Cyan's original release of their plugin. The log files show that it's having a syntax error with

Code: Select all
class AgeInstance():
    def __init__(self, ageData):
        self.ageInfo = ageData[0]
        self.population = ageData[1]
        self.owners = ageData[2]


The error is with the argument parenthesis in AgeInstance():. if I remove them then it passes to the next class which throws up the same error. So if I remove all of them with the exception of the main class "nxuxBookMachine(ptModifier)" it works fine except then it gets an error that it can't find datetime.py.

Re: Error using nxusBookMachine.py in Max

PostPosted: Tue Sep 04, 2012 7:20 am
by Christopher
Do you use the cyan's file or the modified from the H-uru folk?

Christopher

Re: Error using nxusBookMachine.py in Max

PostPosted: Tue Sep 04, 2012 7:27 am
by Paradox
In recent-ish versions of Python 2.x, there's a subtle distinction between class AgeInstance and class AgeInstance().

This uses an "old-style" (2.2-style) class.
Code: Select all
class AgeInstance:


This uses a "new style" class, which extends from the object class.
Code: Select all
class AgeInstance():


I don't remember which version of Python introduced the distinction, but it's possible that Cyan's plugin with Python 2.3 doesn't understand the new style classes.

Re: Error using nxusBookMachine.py in Max

PostPosted: Tue Sep 04, 2012 10:00 am
by GPNMilano
Christopher wrote:Do you use the cyan's file or the modified from the H-uru folk?

Christopher


Using Huru's nxusBookMachine.py with Cyan's max plugin.

Paradox wrote:In recent-ish versions of Python 2.x, there's a subtle distinction between class AgeInstance and class AgeInstance().

This uses an "old-style" (2.2-style) class.
Code: Select all
class AgeInstance:


This uses a "new style" class, which extends from the object class.
Code: Select all
class AgeInstance():


I don't remember which version of Python introduced the distinction, but it's possible that Cyan's plugin with Python 2.3 doesn't understand the new style classes.


I'm assuming that the above is correct. So I'm attempting to build a new version of the plugin using 2.7. Getting some errors though, it builds fine. Max is having issues itself with the water components, as well as a few other missing items. It's complaining that it's missing dlls for Plasma 2.0. So I'm assuming I need to rebuild both my plugin and my client. Doing so as we speak.

Re: Error using nxusBookMachine.py in Max

PostPosted: Tue Sep 04, 2012 12:53 pm
by Tsar Hoikas
Python 2.3 supports new-style classes just fine (they were introduced in 2.2). Just change it to

Code: Select all
class AgeInstance(object):

Re: Error using nxusBookMachine.py in Max

PostPosted: Wed Sep 05, 2012 6:47 am
by GPNMilano
Tsar Hoikas wrote:Python 2.3 supports new-style classes just fine (they were introduced in 2.2). Just change it to

Code: Select all
class AgeInstance(object):


Okay changing it just brings up the datetime error again. Looking at the sources it appears that Cyan's Client/Plugin, compiled with Python 2.2 didn't include the datetime.h file that is used when compiling the Huru Client/Plugin. Which means to use Huru's nxusBookMachine.py in Max I'd still have to compile my own plugin. Which is fine, I did that. But all the WaveSet components are missing in Max when using a newly compiled plugin.

Re: Error using nxusBookMachine.py in Max

PostPosted: Wed Sep 05, 2012 5:49 pm
by Branan
Does the waveset component appear in the list but is missing from loaded objects? Or is it gone entirely?

If the former, could you create a minimal max file containing a waveset (I suppose generated with Cyan's plugin). That will make these sorts of things much easier to debug. I only have access to newer Max versions, so I can't load Cyan's plugin in order to generate test files.

Either way, opening an issue over on Github would be fantastic. Otherwise this is liable to get forgotten.

Re: Error using nxusBookMachine.py in Max

PostPosted: Thu Sep 06, 2012 5:51 pm
by GPNMilano
Branan wrote:Does the waveset component appear in the list but is missing from loaded objects? Or is it gone entirely?

If the former, could you create a minimal max file containing a waveset (I suppose generated with Cyan's plugin). That will make these sorts of things much easier to debug. I only have access to newer Max versions, so I can't load Cyan's plugin in order to generate test files.

Either way, opening an issue over on Github would be fantastic. Otherwise this is liable to get forgotten.


I opened up an issue as suggested. It is gone entirely. The whole Water menu is missing, Wavesets, Enviornment map, Shoreline and water decals. The objects don't have any of the previously attached components and it spits out errors for each missing component on start up, but the file still opens just without them there. As I stated I'm going to attempt to recompile a new plugin with the most recent sources, so I can start using the current python scripts within 3ds Max. The version I compiled that threw up this error was a few months old but from a look at the commits it hadn't seemed that any work was done with the plugin in the time since I had updated my local repo.

EDIT: I should have some time to make a minimal max file and send it to you this weekend if you'd like.