PDA

View Full Version : skinOps, clothOps, cacheOps...


Eugenio
03-27-2008, 02:58 PM
Why these require us be in the modifier stack with the given modifier selected to work? This makes scripts to run sooo much slower...

This may sound as a really dumb question for you guys more "deep" in the programing field, but what is exactly the definition of an interface in maxscript?

Regards,

Jr.

RustyKnight
03-27-2008, 11:15 PM
I'm sure others can help me elaberate on this topic, but as I understand it, an interface is essentially a "contract" that states that this API will have these functions, but the physical implementation is unknow (and for the most part, unimportant).

It allows the developers to say, "Here, you can do this!" and we don't care how it is implemented, but they can change the implementation over time, but we are not tied to that implementation.

It's a very powerful construct in OO, because you can essentially design a "public" API to your classes, without the need to expose the inner workings of the API AND have the ability to provide different implementations depending on what your needs are or if you have a better way to do the work, but without the need for the users of the API to change there workflow.

Think of this. You want to store some data. Now you really don't care how it is stored, you just want it stored somewhere you can get to it.

A developer would provide a interface that would expose the "essentially" functions to get this done (lets say read and write for argument) and a basic implementation that stores the data in a text file on the local system. Cool, you can read and write stuff...

Now you think to yourself, it would be really cool if everyone could store stuff in a central location so we can share stuff more easily. Using the same interface (so you api does not change), the developer can provide a "SQL Database" implementation, which you can drop in and start using relativly eaisly...no need to re-write (in a really good case, anything)...

Now you want to store stuff in the registery, or in XML or some other format!! Just drop in the implementation of the interface and you don't need to change much about your code!

That's kinda over the top, but the basic idea is there...hope that makes some kind of sense...;)

kees
03-28-2008, 04:27 AM
it shouldn't be significantly slower as long as you properly turn off various things.

Such as 'with redraw off ()' and a few others.


But it is a pain sometimes to have to activate the modifier panel that's for sure.

RustyKnight
03-28-2008, 05:23 AM
The problem arises if in your script you are repeatedly openning the modifier panel...this sucks a lot of time.

What I've done recently was to do a check to see if the modifier panel was open, if it wasn't open it, otherwise, continue processing, this did help...but switching between objects causes the mod pane to constantly refresh it self...slowing things down...

I also find that I either skipped over or it wasn't mentioned, that these functions require the mod pane to be open...that took me some weeding out to discover...:P

Cheers
Shane

Bobo
03-28-2008, 07:00 AM
This may sound as a really dumb question for you guys more "deep" in the programing field, but what is exactly the definition of an interface in maxscript?


Back in Max 2 when MAXScript was first introduced, every function and property accessible to MAXScript had to be implemented by hand by the programmer of the scripting language. For example, in order to expose the properties of the Box primitive, the MAXScript developer had to specifically implement a MAXScript version of the box and allow the user of the language to set the object's properties. Similarly, for every function available, in, say, Editable Mesh, the MAXScript programmer had to write specific code to make this functionality accessigle to the user.

This was obviously tedious work, so in Max 3, the Parameter Block 2 was implemented which automated the first part of the task - automatically exposing properties of objects to MAXScript and also automatically emitting MacroRecorder code when these were set and changed. But for the deeper functionality, for example to expose the new Schematic View functions in Max 3, the programmers still had to write specific MAXScript functions independently from the underlying code already written in C++ to make certain features scriptable.

So in Release 4, the so-called Function Publishing System was introduced. It allowed the developer of a Max feature (and NOT the developer of MAXScript) to expose properties, methods and actions of the underlying C++ code to MAXScript with *relatively* little effort. Thus, since Max 4, most new features added to the software were exposed to MAXScript by their respective developers without the need for the MAXScript developers to deal with that. For example, Peter Watje not only wrote the Skin modifier and the UVW Unwrap modifier, but also exposed all their features via a series of Function Publishing Interfaces (the Unwrap has already 7 such interfaces, one for each release that added features to the modifier!).

There are a couple of Inerface types like Core Interfaces (which expose core functions to MAXScript that are not "owned" by a specific object), Node Interfaces (which expose methods and properties of scene objects to MAXScript) and MixinInterfaces (which expose plugin functionality by Interfaces that are sub-classes of the plugins).

You don't really have to understand how they work internally, just how to use them. The Interface Inspector Functions like showInterfaces() and showInterface() are your friends, and the MAXScript Help lists mosts of them, too ;)

sunboy69
03-28-2008, 09:05 AM
Back in Max 2 when MAXScript was first introduced, every function and property accessible to MAXScript had to be implemented by hand by the programmer of the scripting language. For example, in order to expose the properties of the Box primitive, the MAXScript developer had to specifically implement a MAXScript version of the box and allow the user of the language to set the object's properties. Similarly, for every function available, in, say, Editable Mesh, the MAXScript programmer had to write specific code to make this functionality accessigle to the user.

This was obviously tedious work, so in Max 3, the Parameter Block 2 was implemented which automated the first part of the task - automatically exposing properties of objects to MAXScript and also automatically emitting MacroRecorder code when these were set and changed. But for the deeper functionality, for example to expose the new Schematic View functions in Max 3, the programmers still had to write specific MAXScript functions independently from the underlying code already written in C++ to make certain features scriptable.

So in Release 4, the so-called Function Publishing System was introduced. It allowed the developer of a Max feature (and NOT the developer of MAXScript) to expose properties, methods and actions of the underlying C++ code to MAXScript with *relatively* little effort. Thus, since Max 4, most new features added to the software were exposed to MAXScript by their respective developers without the need for the MAXScript developers to deal with that. For example, Peter Watje not only wrote the Skin modifier and the UVW Unwrap modifier, but also exposed all their features via a series of Function Publishing Interfaces (the Unwrap has already 7 such interfaces, one for each release that added features to the modifier!).

There are a couple of Inerface types like Core Interfaces (which expose core functions to MAXScript that are not "owned" by a specific object), Node Interfaces (which expose methods and properties of scene objects to MAXScript) and MixinInterfaces (which expose plugin functionality by Interfaces that are sub-classes of the plugins).

You don't really have to understand how they work internally, just how to use them. The Interface Inspector Functions like showInterfaces() and showInterface() are your friends, and the MAXScript Help lists mosts of them, too ;)
Hello,Bobo,I'm confused recently,because there's a question that i could not solved,can you help me?

CGTalk Moderation
03-28-2008, 09:05 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.