Public Types | Public Member Functions

MaxBakeElement Class Reference

Search for all occurrences

Detailed Description

See also:
Class IRenderElement , Class MaxRenderElement

Description:
This class is only available in release 5 or later.

The class provides the interfaces for creating a Texture Baking plugins in 3ds Max. The texture baking plugins are controlled through the Maxscript "Render To Texture". There are methods available in this class that provide the ability to produce a dynamic UI in Maxscript.

This class provides the basic infrastructure for the UI and Maxscript interaction, to fully understand the workings of these plugins please look at the RenderElement samples

For an example of this class in use by Texture Baking plug-ins see /MAXSDK/SAMPLES/RENDER/RENDERELEMENTS/INCLUDE/STDBAKEELEM.CPP

All methods of this class are virtual.

#include <renderelements.h>

Inheritance diagram for MaxBakeElement:
Inheritance graph
[legend]

List of all members.

Public Types

enum   { IID = 0xeffeefff }

Public Member Functions

virtual void  SetOutputSz (int xSz, int ySz)=0
virtual void  GetOutputSz (int &xSz, int &ySz) const =0
virtual void  SetFileName (const MCHAR *newName)=0
virtual void  SetFileName (MCHAR *newName)
virtual const MCHAR *  GetFileName () const =0
virtual void  SetFileType (const MCHAR *newType)=0
virtual void  SetFileType (MCHAR *newType)
virtual const MCHAR *  GetFileType () const =0
virtual void  SetFileNameUnique (BOOL on)=0
virtual BOOL  IsFileNameUnique () const =0
virtual void  SetRenderBitmap (Bitmap *pBitmap)=0
virtual Bitmap GetRenderBitmap () const =0
virtual void  SetLightApplied (BOOL on)=0
virtual BOOL  IsLightApplied () const =0
virtual void  SetShadowApplied (BOOL on)=0
virtual BOOL  IsShadowApplied () const =0
virtual void  SetAtmosphereApplied (BOOL on)=0
virtual BOOL  IsAtmosphereApplied () const =0
virtual BOOL  AtmosphereApplied () const
virtual BOOL  ShadowsApplied () const
virtual int  GetNParams () const =0
virtual const MCHAR *  GetParamName (int nParam)=0
virtual const int  FindParamByName (MCHAR *name)=0
virtual int  GetParamType (int nParam)=0
virtual int  GetParamValue (int nParam)=0
virtual void  SetParamValue (int nParam, int newVal)=0
SClass_ID  SuperClassID ()
virtual void *  GetInterface (ULONG id)
virtual void  ReleaseInterface (ULONG id, void *i)

Member Enumeration Documentation

anonymous enum
Enumerator:
IID 
{ IID = 0xeffeefff };

Member Function Documentation

virtual void SetOutputSz ( int  xSz,
int  ySz 
) [pure virtual]
Remarks:
Set the size of the bitmap to be created

Parameters:
int xSz

Specifies the width of the output.

int ySz

Specifies the height of the output.

virtual void GetOutputSz ( int &  xSz,
int &  ySz 
) const [pure virtual]
Remarks:
Get the size of the bitmap to be created

Parameters:
int& xSz

The new width

int& ySz

the new height

virtual void SetFileName ( const MCHAR *  newName ) [pure virtual]
Remarks:
This is the name used in the UI, so it does not consist of the path - just the actual file name

Parameters:
MCHAR* newName

The name to set for the UI

virtual void SetFileName ( MCHAR *  newName ) [inline, virtual]
{ SetFileName(const_cast<const MCHAR*>(newName)); }
virtual const MCHAR* GetFileName ( ) const [pure virtual]
Remarks:
Returns the actual filename. See remark above

virtual void SetFileType ( const MCHAR *  newType ) [pure virtual]
Remarks:
This is full name of the file including path, that is used by the renderer to actually create the bitmap to store the baked element. This should not really be set as it is created dynamically for sole use by the renderer.

Parameters:
MCHAR* newType

The name for the full file name

virtual void SetFileType ( MCHAR *  newType ) [inline, virtual]
{ SetFileType(const_cast<const MCHAR*>(newType)); }
virtual const MCHAR* GetFileType ( ) const [pure virtual]
Remarks:
Returns the filename used for this baked element - See comment above

virtual void SetFileNameUnique ( BOOL  on ) [pure virtual]
virtual BOOL IsFileNameUnique ( ) const [pure virtual]
virtual void SetRenderBitmap ( Bitmap pBitmap ) [pure virtual]
Remarks:
The render will create a bitmap from the data available and will pass the Bitmap to the plugin. This will be the Bitmap the max actually uses to render to.

Parameters:
Bitmap* pBitmap

The bitmap used for the output

virtual Bitmap* GetRenderBitmap ( ) const [pure virtual]
Remarks:
Returns the bitmap containing the final output

virtual void SetLightApplied ( BOOL  on ) [pure virtual]
Remarks:
This defines whether the baker uses lighting or not. For example a diffuse texture baker can specify whether the result uses lighting or not.

Parameters:
BOOL on

The state for the lighting parameter

virtual BOOL IsLightApplied ( ) const [pure virtual]
Remarks:
Returns whether lighting is used in the calculation

virtual void SetShadowApplied ( BOOL  on ) [pure virtual]
Remarks:
This defines whether the baker uses shadows or not. For example a diffuse texture bake can specify whether the result uses shadows or not.

Parameters:
BOOL on

The state for the shadow parameter

virtual BOOL IsShadowApplied ( ) const [pure virtual]
Remarks:
Returns whether shadows are used in the calculation

virtual void SetAtmosphereApplied ( BOOL  on ) [pure virtual]
Remarks:
Defines whether the texture baking uses Atmosphere in the final result.

Parameters:
BOOL on

Specifies whether Atmospheres are used or not.

virtual BOOL IsAtmosphereApplied ( ) const [pure virtual]
Remarks:
Returns whether Atmospheres are used. Most texture baking plugins would return false.

virtual BOOL AtmosphereApplied ( ) const [inline, virtual]
Remarks:
This method returns TRUE if atmospheric effects for the Render Element are enabled, otherwise FALSE.

Implements IRenderElement.

                                           {
            return IsAtmosphereApplied();
        }
virtual BOOL ShadowsApplied ( ) const [inline, virtual]
Remarks:
This method returns TRUE if shadows for the Render Element are enabled, otherwise FALSE.

Implements IRenderElement.

                                        {
            return IsShadowApplied();
        }
virtual int GetNParams ( ) const [pure virtual]
Remarks:
Return the number of parameters to be exposed to the UI

virtual const MCHAR* GetParamName ( int  nParam ) [pure virtual]
Remarks:
Returns the name used by maxscript for the parameter value passed in. This is a 1 based access, so if GetNParams returned 8 the valid range for GetParamName will be 1 to 8.

Parameters:
int nParam

The value for the parameter whose name is to be returned.

virtual const int FindParamByName ( MCHAR *  name ) [pure virtual]
Remarks:
Returns the index of the parameter based on the name

    const int FindParamByName1( MCHAR* name )
    {
        for( int i = 0; i < 8; ++i ) {
            if( strcmp( name, GetString( paramNames[i] )) == 0
                )
                return i+1;
        }
        return 0;
    }
virtual int GetParamType ( int  nParam ) [pure virtual]
Remarks:
Currently only 1 = Boolean, 0 = Undefined are supported. In release 5 this means that any parameter you have is defined and used as a Boolean in maxscript

Parameters:
int nParam

The value for the parameter whose type is to be returned.

Implemented in MaxBakeElement8.

virtual int GetParamValue ( int  nParam ) [pure virtual]
Remarks:
The value to set when the Render to Texture tool is loaded

Parameters:
int nParam

The value for the parameter whose value is to be returned.

virtual void SetParamValue ( int  nParam,
int  newVal 
) [pure virtual]
Remarks:
The Render to Texture Tool will save out the data
Parameters:
int nParam

The value for the parameter whose value is to be set

int newVal

The value to set
SClass_ID SuperClassID ( ) [inline, virtual]
Remarks:
This method returns the plugin's SuperClass ID.
Default Implementation:
{ return RENDER_ELEMENT_CLASS_ID; }

Reimplemented from IRenderElement.

{ return BAKE_ELEMENT_CLASS_ID; }
virtual void* GetInterface ( ULONG  id ) [inline, virtual]
Remarks:
The renderer will call this method to see if IRenderElement is compatible with it This is used for future expansion in interface classes. When the 3ds Max development team needs to add additional functionality to an interface class this method provides a way to do that without breaking the API. If the 3ds Max developers would add methods to an existing class it would invalidate the plug-ins that used the class. Using thismethod allows additional functionality to be added to the interface class without breaking the API.
Parameters:
ULONG id

Currently this is not used and is reserved for future use.

Reimplemented from MaxRenderElement.

Reimplemented in MaxBakeElement8, and MaxBakeElement10.

{ return (id == IID) ? this : MaxRenderElement::GetInterface(id);}
virtual void ReleaseInterface ( ULONG  id,
void *  i 
) [inline, virtual]
Remarks:
This method is not currently used. It is reserved for future use. Its purpose is for releasing an interface created with GetInterface().

Reimplemented from MaxRenderElement.

{ UNUSED_PARAM(id); UNUSED_PARAM(i); }

MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement
MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement MaxBakeElement