Sophie

Sophie

distrib > Arklinux > devel > i586 > media > main > by-pkgid > 2c46997be5021ee3173c5af9332905d7 > files > 870

blender-manual-2.49a-1ark.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><TITLE
>Specification:</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="Blender Documentation Volume I - User Guide"
HREF="book1.html"><LINK
REL="UP"
TITLE="Blender's Plugins System"
HREF="c10609.html"><LINK
REL="PREVIOUS"
TITLE="Blender's Plugins System"
HREF="c10609.html"><LINK
REL="NEXT"
TITLE="Generic Texture Plugin:"
HREF="x10790.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Blender Documentation Volume I - User Guide: Last modified April 29 2004 S68</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="c10609.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Blender's Plugins System</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x10790.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="section_plugin_texture_specs"
></A
>Specification:</H1
><P
></P
><UL
><LI
><P
>&#13;          <I
CLASS="emphasis"
>#include &#60;plugin.h&#62;</I
>
        </P
><P
>&#13; Every Blender plugin should include this header
 file, which contains all of the structures and
 defines needed to properly work with Blender.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>char name[]="Tiles";</I
>
        </P
><P
>&#13; A character string containing the plugin name,
 this value will be displayed for the texture's title
 in the Texture Buttons window. 
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>#define NR_TYPES 2
 char stnames[NR_TYPES][16]= {"Square", "Deformed"};</I
>
        </P
><P
>&#13; Plugins are allowed to have separate subtypes for
 minor variations on algorithms - for example the
 default clouds texture in Blender has the "Default"
 and "Color" subtypes. 
        </P
><P
>&#13;NR_STYPES should be defined to the number of
 subtypes required by your plugin, and a name
 for each subtype should be given. Every plugin
 should have at least 1 subtype and a subtype name.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>VarStruct varstr[]= {...};</I
>
        </P
><P
>&#13; The varstr contains all of the information
 Blender needs to display buttons for a plugin.
 Buttons for plugins can be numerical for
 input data, or text for comments and other
 information. Plugins are limited to a maximum
 of 32 variables. 
        </P
><P
>&#13;Each VarStruct entry consists of a type, name,
 range information, and a tool tip. 
        </P
><P
>&#13;          <I
CLASS="emphasis"
>The type</I
> defines the data type for each button
 entry, and the way to display the button. For number 
 buttons
 this value should be a combination (ORed) of INT
 or FLO for the number format, and NUM, NUMSLI, or
 TOG, for the button type. Text buttons should have
 a type of LABEL. 
        </P
><P
>&#13;          <I
CLASS="emphasis"
>The name</I
> is what will be displayed on 
 (or beside)
 the button. This is limited to 15 characters. 
        </P
><P
>&#13;          <I
CLASS="emphasis"
>The range information</I
> consists of three floats
 that define the default, minimum, and maximum values
 for the button. For TOG buttons the minimum is
 set in the pressed state, and the maximum is set
 in the depressed state. 
        </P
><P
>&#13;          <I
CLASS="emphasis"
>The tip</I
> is a string that will be displayed 
 when
 the mouse is over this button (if the user has tool tips
 on). This has a limit of 80 characters, and should be
 set to the NULL string ("") if unused.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>typedef struct Cast {...};</I
>
        </P
><P
>&#13; The cast structure is used in calling the
 doit function, and serves as a way to simply
 access each plugin's data values. 
        </P
><P
>&#13;The cast should contain, in order, an integer
 or float for every button defined in the varstr,
 including text buttons. Typically these should
 have the same name as the button for simple
 reference.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>float result[8];</I
>
        </P
><P
>&#13; The result array is used to pass information
 to and receive information from the plugin.
 The result values are mapped as follows:
        </P
><DIV
CLASS="informaltable"
><A
NAME="AEN10661"
></A
><P
></P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
><I
CLASS="emphasis"
>Result Index</I
></P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
><I
CLASS="emphasis"
>Significance</I
></P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
><I
CLASS="emphasis"
>Range</I
></P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[0]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>Intensity value</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>0.0 to 1.0</P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[1]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>Red color value</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>0.0 to 1.0</P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[2]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>Green color value </P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>0.0 to 1.0</P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[3]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>Blue color value </P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>0.0 to 1.0</P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[4]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>Alpha color value </P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>0.0 to 1.0</P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[5]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>X normal displacement
 value</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>-1.0 to 1.0</P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[6]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>Y normal displacement
 value</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>-1.0 to 1.0</P
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>result[7]</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>Z normal displacement
 value</P
></TD
><TD
WIDTH="33%"
ALIGN="LEFT"
VALIGN="MIDDLE"
><P
>-1.0 to 1.0</P
></TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
><P
>&#13; The plugin should always return an intensity value.
 Returning RGB or a normal are optional, and should be 
 indicated by the doit()
 return flag
 "1" (RGB) or "2" (Normal).
        </P
><P
>&#13; Before the plugin is called, Blender includes the 
 current rendering-normal
 in result[5], result[6] and result[7].
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>float cfra</I
>
        </P
><P
>&#13; The cfra value is set by Blender to the current
 from before every render pass. This value is
 an the frame number +/- .5 depending on the field
 settings.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>plugin_tex_doit prototype</I
>
        </P
><P
>&#13; The plugin_tex_doit function should be prototyped
 for use by the getinfo function. You do not need
 to change this line.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>plugin_tex_getversion</I
>
        </P
><P
>&#13; This function must be in each plugin for it
 to be loaded correctly. You should not change
 this function.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>plugin_but_changed</I
>
        </P
><P
>&#13; This function is used to pass information
 about what buttons the user changes in
 the interface. Most plugins should not need
 to use this function, only when the interface
 allows the user to alter some variable
 that forces the plugin to do recalculation
 (a random hash table for example).
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>plugin_init</I
>
        </P
><P
>&#13; If needed plugins may use this function
 to initialize internal data. NOTE: This init
 function can be called multiple times if the same
 plugin texture is copied. Do not init global data
 specific to a single instance of a plugin in this
 function.
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>plugin_getinfo</I
>
        </P
><P
>&#13; This function is used to communicate information to
 Blender. You should never need to change it. 
        </P
></LI
><LI
><P
>&#13;          <I
CLASS="emphasis"
>plugin_tex_doit</I
>
        </P
><P
>&#13; The doit function is responsible for returning
 information about the requested pixel to
 Blender.
        </P
><P
>&#13;          <I
CLASS="emphasis"
>The Arguments</I
>
        </P
><P
></P
><UL
><LI
><P
>&#13;              <I
CLASS="emphasis"
>int stype</I
>
            </P
><P
>&#13; This is the number of the selected subtype,
 see the <I
CLASS="emphasis"
>NR_TYPES</I
> and <I
CLASS="emphasis"
>char stypes</I
>
 entries above.
            </P
></LI
><LI
><P
>&#13;              <I
CLASS="emphasis"
>Cast *cast</I
>
            </P
><P
>&#13; The Cast structure which contains the plugin
 data, see the <I
CLASS="emphasis"
>Cast</I
> entry above.
            </P
></LI
><LI
><P
>&#13;              <I
CLASS="emphasis"
>float *texvec</I
>
            </P
><P
>&#13; This is a pointer to 3 floats, which are the
 texture coordinates for which a texture value
 is to be returned.
            </P
></LI
><LI
><P
>&#13;              <I
CLASS="emphasis"
>float *dxt
 float *dyt</I
>
            </P
><P
>&#13; If these pointers are non-NULL they point to
 two vectors (two arrays of three floats) that
 define the size of the requested texture
 value in pixel space. They are only non-NULL
 when OSA is on, and are used to calculate
 proper anti aliasing.
            </P
></LI
></UL
><P
>&#13; The doit function should fill in the result array
 and return 0,1,2, or 3, depending on what values have
 been filled in. The doit function should <I
CLASS="emphasis"
>always</I
>
 fill in an intensity value. If the function fills in
 a color value it should return 1, if it fills in a
 normal value it should return 2, if it fills in
 everything it should return 3.
        </P
></LI
></UL
><P
>&#13;      <I
CLASS="emphasis"
>Texture/Material Interaction</I
>
    </P
><P
>&#13; Blender is somewhat different from most 3D packages
 in the logical separation between textures and materials.
 In Blender textures are objects that return certain
 values, signal generators in fact. Materials control the
 mapping of textures onto objects, what is affected,
 how much, in what way, etc.  Properly designed plugins should only include
 variables to affect the signal returned not the
 mapping of it. Buttons to control scale, range,
 axis, etc. are best only included when they make
 the texture easier to use (in the case of the size
 button in the Tiles plugin)
 or they speed up the calculation 
 (the Intensity/Color/Bump subtypes in the Clouds2 plugin).
 Otherwise the Material Buttons make these buttons redundant,
 and the interface becomes needlessly complex. 
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="c10609.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x10790.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Blender's Plugins System</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c10609.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Generic Texture Plugin:</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>