Usando el exportador
From Blender2crystal
SECCIÓN PARA IR TRADUCIENDO AL CASTELLANO:
algo de información acerca de este exportador (gran parte tomada del README del blend2cs :))
[edit] Introducción
Blender2crystal es un plugin para blender capaz de exportar al formato xml de CrystalSpace y de empaquetar y generar todos los datos necesarios del juego en un archivo .zip que puede ser usado directamente por crystalspace.
Este es un manual básico para el blender2crystal (este plugin), pero la mayor parte de lo que contiene es igualmente aplicable al exportador de linea de comandos blend2cs, el exportador de referencia de CrystalSpace (CS). Existe una Guía de compatibilidad entre blend2cs y este exportador, para que ambas herramientas puedan usarse de forma intercambiable.
El plugin también ofrece una interfaz para definir propiedades expecíficas para crystalspace desde el blender.
Una lectura cuidadosa del material ofrecerá muchos detalles acerca de la construcción adecuada de un nivel, y de como definir las propiedades para los distintos objetos, y está recomendada antes de comenzar a exportar esos niveles.
[edit] Interfaz de usuario
(fijate en que nos aproximamos a un nuevo release por lo tanto toda la información se refiere a la versión cvs)
[edit] Descripción
La ventana del exportador esta dividida en tres partes, cabecera, area central, y barra de estado. El interfaz esta dividido en varias secciones para una sencilla búsqueda de funcionalidades. Las secciones se pueden cambiar usando el menú de la parte izquierda de la cabecera.
[edit] Cabecera
La pequeña cabecera es la parte permanente del exportador. Aquí tenemos un menú para navegar por las siguientes secciones del exportador además de los principales botones de este.
[edit] Botones principales del exportador
La letra dentro del paréntesis es la tecla de acceso rápido a la función correspondiente.
Export (E): Crea el archivo zip.
Run (R): Crea el archivo zip y lo ejecuta con el walktest de Crystal.
View (V): Lanza el objeto seleccionado con el Viewmesh.
Quit (Q): Salimos del script.
[edit] Area Central (Secciones)
En este area accedemos a las funciones propias de la sección seleccionada.
La sección se cambia en el menú de la cabecera anteriormente citado.
[edit] Barra de estado
En este area se muestra el último mensaje generado por el exportador.
[edit] Secciones
[edit] Main ( Principal )
Esta es la primera sección del exportador. Aqui podremos configurar algunas opciones del exportador.
[edit] Paths
Dir: es el directorio donde guardaremos lo exportado.
File: es el nombre del archivo zip que almacenará los datos.
Tex: es el directorio dentro del .zip donde nos guardará las texturas creadas.
Crystal: la localización del directorio de Crystalspace detectado de la variable de entorno de Crystal. Puede modificarse.
[edit] Botones
Library: exporta como una libreria.
Selected: exporta solo los objetos seleccionados.
Relight: reilumina el mapa al ejecutarlo.
Cel: exporta el mapa con el gestor de entidades.
[edit] Tools Section (sección de herramientas)
La sección de herramientas es un buscador para plugins adicionales proporcionados por el exportador. Está pensado para hacer más sencilla la creación con Blender de mapas para Crystal Space.
[edit] MassTag
Una herramienta para fijar diferentes tipos (type) y propiedades en todos los objetos seleccionados.
[edit] Importador Cal3D
Una herramienta para importar un personaje cal3d externo seleccionando el archivo .cfg y asignándolo a una malla.
[edit] Seleccionar
Para seleccionar grupos de objetos basándonos en las diferentes propiedades o tipos.
[edit] Upload
Una herramienta experimental para subir los datos del último world exportado a una base de datos de CrystalSpace.(actualmente http://delcorp.org/csark/).
La base de datos debe fragmentar y clasificar los datos entrantes y ofrecerlos al público en diferentes interfaces. En un futuro esperamos que en un futuro el exportador también pueda importar estos datos al Blender desde la citada Base de datos.
[edit] Portal Tool
Desde la selección de una malla en Blender y un sector de destino esta herramienta crea un portal espejo en el sector elegido, y aplica todas las propiedades necesarias para que ambas mallas sean un portal de dos direcciones entre ambos sectores.
[edit] Sección de ayuda (help)
Una sección de ayuda on-line para el exportador, por el momento solo se muestran algunas observaciones.
[edit] Sección Object Browser
El Object Browser es una herramienta para aplicar instintivamente las propiedades relativas a CrystalSpace a un objeto seleccionado en blender.
Tiene dos botones, GET y SET. Get debe ser pulsado para que el exportador recoja la información existente sobre las propiedades del objeto seleccionado.Después de haber configurado los parámetros deseados debemos pulsar SET para que estos sean aplicados en el objeto.
[edit] Sección Status
Esta sección donde se muestran todos los mensajes relativos a las acciones del exportador. Deberá ser comprobado para detectar avisos especiales relativos a los procesos del exportador.
[edit] Sectores
Los mapas para CS son divididos habitualmente en varios sectores. Esto lo representamos en Blender a traves de las diferentes escenas. Cada escena será un sector con sú mismo nombre (el de la escena).
[edit] Factorias y objetos
En CristalSpace así como en Blender hay una clara distinción entre el objeto y la malla a la cual hace referencia (la factoría). De esta forma, varios objetos pueden compartir factoría y así ahorrar tiempo de procesado y espacio.
La correspondencia entre los "Mesh Data Objects" (nombre tras la abreviatura ME, ej ME:Cube.002) y las factorías de CS no es directa, debido a que hay diferentes propiedades en ambos sistemas, así como en CS hay diferentes tipos de malla que Blender no contempla.
Lo principal aquí es diferenciar claramente entre ME (los datos de la malla) y OB (el objeto referenciado) en Blender. El OB es lo que vemos, mientras que ME son los datos, que pueden ser compartidos por varios objetos.
Cuando exportamos el nombre ME será asignado a la factoría, mientras que OB nombrará el objeto individual. Ambos nombres los podemos cambiar en la pestaña Edición de la ventana de botones (F9) de Blender.
Los datos compartidos son más fáciles de archivar en Blender usando ALT-D para hacer un duplicado enlazado. De esta forma, al modificar en modo edición la malla modificaremos todos los objetos enlazados. Para asegurarnos de que los datos sean compartidos es importante no escalar los objetos (fuera del modo edición), de otra forma CS (o al menos este exportador) no podrá usar las factorías.
Actualmente se pueden generar factorías para los tipos terrain, thing, genmesh y cal3d.
[edit] Materiales
Las imágenes de los materiales serán también introducidos en el archivo zip si existiesen. Fijaté en que las texturas hayan sido desempaquetadas para hacer esto correctamente.
Hay varias maneras de texturizar un objeto, a través de coordenadas UV para una textura, a través de Vertex Colors ( ver documentación de Blender), o dotar sombras utilizando mapas de normales. Sólo algunas propiedades seleccionadas de los materiales son exportadas actualmente. Ten en cuenta que mientras CS está diseñado para renderizar a tiempo real, Blender esta pensado para otro tipo de render off-line.
[edit] Mapeo UV
La manera básica de definir texturas es a través de mapeo de texturas UV sobre los polígonos. Para esto debes de entrar en el modo "Selector de caras UV" (tecla F) y selecciona la imagen en el "Editor de Imágenes UV" de Blender. El mapeo sólo quedará bien en los objetos tipo "thing" si esta compuesto de caras cuadradas o triangulares, para "genmesh" trabaja igual que en Blender.
[edit] Vertex Colours
Los Vertex colours son soportados sólo en los tipo "genmesh" y "sprite 2d". Si el objeto no tiene material o textura UV asignada los Vertex Colours se exportaran directamente. En caso de que queramos mezclar texuras UV con Vertex Colours tendremos que asignarlo un material en Blender y setear la opción VCol Paint.
[edit] Ajustes de los Materiales de Blender
Usando los materiales de Blenderr se pueden conseguir bellos efectos cuando se exporta con el nuevo Renderloop(el render actual de CrystallSpace en el CVS), usando shaders internamente (nota sin embargo que los shaders en Blender no están utilizados para el proceso de exportación ).
La idea básica es ese MapTo: la característica de las texturas asignadas a los materiales se utiliza como llave para usar la textura en diversas maneras
Hasta ahora sólo está soportado es el NOR, el cual hará que la textura se exporte como un BumpMap sobre el objeto. Se está trebajando en que Hard haga que la textura se exporte como un mapa de detalle, y esperamos poder usar más en el futuro. Por defecto la textura se exporta como una textura base.
Si un material tiene por lo menos una textura con NOR, esta será exportada como bumpmap. Si tiene una textura con HARD lo será como mapa de detalle, si no será exportada con las sombras estandar.
Otras opciones del material serán analizadas, pero no afectarán a la hora de exportar a CS: alpha (en tipos "genmesh" será puesto el modo de mezcla (mixmode) "add", alpha no está soportado; para tipos "thing" el modo "alpha" se usará con el actual slider en el boton de materiales de Blender. Shadeless, Shadow. Note that alpha support will probably change as support for shaders gets better.
[edit] Texturas procedurales animadas
Es posible desactivar la textura UV mapeada y definir una textura procedural disponible con CrystallSpace como material del objeto.
Esto se consigue asignando la propiedad proctex al objeto. Los valores posibles son plasma, water, fire, sky y dots (estrellas).
El mapeo UV se mantendra, pero en vez de la imagen seleccionada en Blender, tendremos la textura procedural.
[edit] Parámetros del blender
Los siguientes parámetros del blender son interpretados y usados en CS:
-Autosmooth, parea redondear polígonos.
[edit] Tipos del objeto
La propiedad más importante de los objetos exportados es el tipo (type). Para lámparas y cámaras tendremos el mismo tipo para Blender y CS. Para mallas es un poco más complicado, el tipo por defecto es "thing", pero se podrá cambiar a alguno de los siguientes.
Lista de tipos soportados:
thing: a normal polygon based/lightmapped object
genmesh: a triangle mesh based object
terrain: para exportar un objeto que sea un terreno (generará el correspondiente mapa de alturas, mapa de materiales y texturas.
cal3d: para exportar un personaje cal3d (este tipo se deberá asignar a través de la herramienta Cal3d Import Tool en la sección de herramientas.
spr2d: un objeto 2d que siempre mira hacia la camara (debe siempre editarse desde la vista de frente de Blender (numpad-1) ), para exportarlo bien deberá de estar compuesto por sólo una cara.
ball: la malla se exportará como una esfera.
sky: la malla se exportará como una esfera configurada por defecto con las propiedades apropiadas para generar un cielo. Las normales miran hacia dentro y seguirá al player en CEL).
node: para exportar un nodo (información asignada a un punto en el espacio que CS podrá analizar).
snow: se exportará como una zona de nieve.
rain: se exportará como una zona de lluvia.
meshlib: este objeto referencia a otra malla definida en el mundo pero no en ningún sector. La geometría del objeto en Blender será ignorada.
meshref: este objeto hace referencia a una factoría definidada en algún otro sitio (por ejemplo, otro archivo "world", librería, o algo creado en código para el juego).La geometría del objeto en Blender será ignorada.
sectorsettings: para ajustar parámetros del sector (sólo uno por sector).
worldsettings: para ajustar parámetros del mapa (sólo uno por mapa).
portal: todos los polígonos se convertirán en un portal hacia otro sector, algunas propiedades deben ser ajustadas en el sector.
A continuación una detallada descripción de los diferentes parámetros que pueden ser asignados a los diferentes tipos de objeto.
[edit] Propiedades
Las siguientes propiedades están soportadas por todos los objetos. Se pueden asignar las propiedades como propiedades de juego en Blender (F4 en la ventana de botones) o a través de la herramienta Object Browser del exportador:
-type, string: (para mallas sólo) Especifica el tipo de objeto que será exportado: especificadas anteriormente.
-zmode, string: Ajusta el zmode del objeto, zuse, zfill, ztest, znone (por defecto zuse)
-colldet, bool: cambia el detector de colisiones del objeto, true or false (por defecto true).
-noclip, bool: cambia el "clip" del objeto, true or false (por defecto false).
-viscull, bool: cambia el "viscull" del objeto, true or false (por defecto true)
-shadows, bool: Especifica si el objeto provocará sombras sobre otros objetos (por defecto true).
-hitbeam, bool: Especifica si el objeto será afectado por el HitBeam (por defecto true).
-priority, string: El nivel de prioridad con el cual CS renderizará el objeto(usualmente sky, wall, object o alpha)(por defecto wall).
-lighting, bool: calcula la iluminación del objeto. El objeto se mostrará completamente brillante si se indica "false" (por defecto true).
-invisible, bool: el objeto se volverá invisible al indicar "true" (por defecto false).
-camera, bool: el objeto se moverá con la camara, dando la sensación de ser interminable(por defecto false).
-closed, bool: Dice a CS que los objetos están cerrados (por ejemplo no tiene ningún agujero). Esto puede optimizar el dynavis culler donde la autodetection no trabaje (defecto falso).
-goodoccluder, bool:este da una pista al dynavis culler de si ese objeto es bueno desechando otra geometria (por defecto false).
-badoccluder, bool: este da una pista al dynavis culler de si ese objeto es malo desechando otra geometria (por defecto false).
-staticpos, bool: en "true" este objeto nunca se moverá. Es practico para el PVS.
-staticshape, bool: en "true" este objeto nunca se podrá animar. Es practico para el PVS
-static, bool: abreviatura para staticpos y staticshape juntos.
-mixmode, string: para definir el modo de mezcle de la malla, puede ser add, alpha, copy, keycolor, multiply2, multiply, o transparent.
-mixmode_alpha, float: un valor entre 0 y 1, es el valor de alpha para el modo de mezcla alpha.
[edit] Parámetros de Material
-proctex, string: los valores posibles son: plasma, water, fire, dots y sky. por defecto esta propiedad no esta definida, añadiendola el exportador ignorará la textura del mapeo UV y asignará la textura procedural señaladqa como material del objeto, el mapeo se guardará pero es importante que la textura mapeada conserve las proporciones 1:1 entre el ancho y el alto.
[edit] Parámetros para Portal
Los portales son umbrales entre dos sectores (escenas en Blender). Pueden ser fijados poniendo la característica portal en una malla o usando la herramienta Portal Tool del exportador.
-portal, string: todos los polígonos del objeto serán un portal con destino al sector indicado en esta propiedad.
-portalwarpbefore, string: the portal will be spacewarping. You can specify a warp vector in the form "x,y,z" that is applied before the warp matrix
-portalwarpafter, string: the portal will be spacewarping. You can specify a vector in the form "x,y,z" that is applied after the warp matrix
-portalrotate, string: The portal will be spacewarping. You can specify a rotation in the form "x,y,z"
-portalflags, string: puedes especificar varias etiquetas al portal:zfill, float, clip, mirror, static, autoresolve, clipstraddling, viscull.
[edit] Propiedades para genmesh (type:genmesh)
-localshadows, bool: (genmesh sólo) hace un cálculo de sombras en ese objeto (por defecto false).
[edit] Propiedades para bolas (type:ball):
-numrim, int: número de bordes en la bola (por defecto 16)
-reversed, bool: coloca las normales mirando hacia dentro( por defecto "false").
-toponly, bool: sólo renderiza media esfera ( por defecto "false").
-cylindrical, bool: mapea la textura con coordinadas cilíndricasa en vez de esféricas ( por defecto "false").
-color, string: color base del objeto, deberá ser de la forma (r,g,b). ( por defecto (1,1,1))
[edit] Propiedades para cielos (type:sky)
el tipo sky exportará una malla como la del tipo ball pero con diferencias en las propiedades por defecto.
-numrim, int: número de bordes en la esfera (por defecto 16)
-reversed, bool: coloca las normales mirando hacia dentro( por defecto "true").
-toponly, bool: sólo renderiza media esfera ( por defecto "false").
-cylindrical, bool: mapea la textura con coordinadas cilíndricasa en vez de esféricas ( por defecto "false").
-color, string: color base del objeto, deberá ser de la forma (r,g,b). ( por defecto (1,1,1))
[edit] Propiedades de Mundo/Sector
Los objetos con los nombres "SectorSettings" o "WorldSettings" no serán exportados pero se analizarán sus propiedades.
Otra opción es poner el tipo "sectorsettings" o "worldsettings" respectivamente.
[edit] WorldSettings
El tipo WorldSettings ajusta parámetros globales en el mapa. Sólo se pondrá uno en todo el mapa.
-clearzbuf, bool: Limpia el zbuffer cada frame.
-clearscreen, bool: Limpia la pantalla cada frame.
-ambient, string: fija la luz ambiente en los mapas. Puedes especificar valores entre 0 y 1 en la forma "r,b,g".
-thingstatic, bool: si está en "true" todos los objetos tipo "thing" serán marcados como static lo cual es importante para el PVS. Por defecto "false". Nota que los objetos pueden ser marcados como estáticos individualmente.
-genmeshstatic, bool: si está en "true" todos los objetos tipo "genmesh" serán marcados como static lo cual es importante para el PVS. Por defecto "false". Nota que los objetos pueden ser marcados como estáticos individualmente.
-renderloop, string: este puede ser uno de los siguientes.
- "standard": (por defecto). Es al mapeado de luces normal que no usa
sombras especiales.
- "std_rloop_diffuse": Es para un nivel que use ambient + diffuse con luces
dinámicas (pero sin sombras). Cuando activamos esta etiqueta los
shaders 'ambient','light', y 'light_bumpmap' son cargados y los
materiales son marcados con ambient' y 'light', también el bumpmap si
está definido a través de los
materiales.
- "std_rloop_shadowed": Este es para un nivel que necesite stencil
shadows. Los 'ambient', 'light', and 'light_bumpmap' shaders son
cargados y los
materiales son marcados con ambient' y 'light', también el bumpmap si
está definido a través de los
materiales.
- "std_rloop_terrainfixed": Es para un nivel que tenga un terreno
usando fixed shaders (como el nivel terrainf en CS).
Es habiyual usar este en combinación con un malla de terreno
(type = terrain).
-global_renderloop, bool:Si esta en true entonces el renderloop según lo especificado arriba será global para todos los sectores. Si esta en false entonces no será global y será marcado específicamente en cada sector. Por defecto es falso.
[edit] SectorSettings
Los objetos tipo SectorSettings para fijar parámetros en el sector.
Sólo se pondrá uno por sector.
-fogcolor, string: Especifica el color de la niebla en ese sector (el color se fijará en la forma (r,g,b) en un rango de 0 a 1)
-fogdensity, float: Especifica la densidad de la niebla en ese sectorSpecify
-culler, string: Este es el visibility culler a usar. Por defecto es igual a 'crystalspace.culling.frustvis'. Otras posibilidades son 'crystalspace.culling.dynavis' y 'crystalspace.culling.pvsvis' (el último está todavia en estado de experimentación). - los nombres pueden ser abreviados quitando la parte "crystalspace.culling.".
-renderloop, string: el renderloop a usar en este sector (los mismos que para worldsettings).
[edit] The renderloop
A través de los SectorSettings y WorldSettings tú puedes fijar los renderloops locales y globales y así conseguir una gran variedad de efectos.
El renderloop especificado es especialmente importante para terrenos y objetos con mapa de relieve.
[edit] Luces
Las luces se exportan de Blender usando su color especificado y la distancia, también algunos tipos de luz son respetados.
[edit] Tipos de luz disponible
Las Spotlamps de Blender son exportadas como Spotlight de Crystal (no soportado en CS todavia).
Las Sunlamps de Blender son exportadas como luz direccional en Crystal (no soportado en CS todavia).
Los demas tipos son exportados como puntos de luz normales.
[edit] Propiedades de luces
Algunas características adicionales pueden ser especificadas agregando características del Blender a la lámpara.
-attenuation, string: el tipo de atenuador para la luz, posibles valores son none, linear, inverse, realistic y clq. No hay por defecto ningún valor en el exportador, (si este valor no esta especificado no se exportará) pero en CS será "clq" el tipo de luz por defecto.
-dynamic, bool: la luz sera eportada como pseudo-dinámica, en vez de estática, el valor por defecto es false.
-halo, string: Hace que la luz emita un halo, los tipos de halo son cross y nova. Tienen las siguientes propiedades particulares.
[edit] Halo tipo cross
-intensity, float: intensidad (0 a 1 o más)
[edit] Halo tipo nova
-seed, int: random seed (un número)
-numspokes, int: número de rayos (10 a 100 dá bonitos resultados) Defecto: 100
-roundness, float: factor de redondez (0 a 1) Defecto: 0.5
[edit] Terrain
Setting the terrain mesh type will add a full terrain. It is usually used in combination with std_rloop_terrainfixed (see WorldSettings).
In addition to the world file blender2crystal will also generate a heightmap, materialmap, and base material.
To use this you basically have to create a mesh from a plane that has the shape of the landscape. blender2crystal will scan that mesh and create a landscape from it. The texture mappings of the triangles on that mesh will be used for the material palette and the vertex painting information will be used for the base material.
One nice plugin for blender that generates suitable land meshes is the A.N.T. Landscape Creator plugin
[edit] TerrainSettings
-terrain_resolution, int: the resolution of the heightmap, materialmap, and base material. Default is 256.
-terrain_heightmap, string: this is the name of the heightmap file. Default is 'heightmap.png'.
-terrain_basematerial_name, string: the name of the base material (not the filename). Default is 'basematerial'.
-terrain_basematerial, string: the filename of the base material. Default is basematerial.png'.
-terrain_materialmap, string: the filename of the material map. Default is 'materialmap.png'.
-terrain_splatting_distance, float: splatting distance. Default 200.
-terrain_block_resolution, int: block resolution. Default 16.
-terrain_block_split_distance, float: block split distance. Default 8.
-terrain_minimum_block_size, float: minimum block size. Default 32.
-terrain_cd_resolution, int: cd resolution. Default 256.
-terrain_cd_lod_cost, float: cd lod cost. Default -1.
-terrain_lightmap_resolution, int: 2lightmap resolution. Default 257.
-terrain_staticlighting, bool: static lighting. Default true.
-terrain_castshadows, bool: caste shadows. Default true.
-terrain_saveheightmap, bool: if true (default) then generate heightmap. if it is not generated the exporter will try to include a previously generated heightmap.
-terrain_savematerialmap, bool: if true (default) then generate materialmap. if it is not generated the exporter will try to include a previously generated materialmap.
-terrain_savebasematerial, bool: if true (default) then generate basematerial. if it is not generated the exporter will try to include a previously generated basematerial.
[edit] Cal3d Exporting
Cal3d inclusion into the map is a bit special because it is a foreign format for both blender and CrystalSpace.
Note that the cal3d files to be included into the map must already be generated. In blender you can generate cal3d files, but this should be done by using the Cal3d export plugin (usually bundled with blender).
For exporting to CrystalSpace through this exporter, the type property must be set to "cal3d", and the "cal3dcfg" property must be set to point to a .cfg cal3d mesh description file in the filesystem.
A special tool is provided to facilitate this task. It can be found in the Tools section of the interface, and allows selecting the .cfg file using a file browser and automatically assigning the necesary properties to the selected object by hitting the "Assign" button.
The exporter will not consider the geometry of the blender object but will instead generate a factory and a meshobject for the cal3d mesh referenced. The cal3d files will also be included into the .zip file, and view can be used from this point on to view the cal3d mesh with viewmesh if so desired.
Some more properties can be set up by hand to assign starting animation for the mesh.
[edit] Cal3d Settings
-cal3dcfg, string: the .cfg file describing the cal3d character. No default. Must be set!
-setaction, string: will set the specified action in cycle mode
-idleaction, string: will set the specified action as idle action for the character (note that this won't affect the starting action unless the idle property is also selected).
-idle, bool: will set the character in idle mode (triggers the idle action).
-rotate_x_axis, bool: will rotate the character over the x axis (default false)
-rotate_y_axis, bool: will rotate the character over the y axis (default false)
-rotate_z_axis, bool: will rotate the character over the z axis (default false)
-flip_textures, bool: will flip textures upside down (default false)
-cal3d_size, float: will scale the character factory (default 0.25)
-cal3d_walk_speed, float: default speed for animations detected as walk animations (with names containing walk) (default 2)
-cal3d_run_speed, float: default speed for animations detected as run animations (with names containing run) (default 5)
[edit] Sequences
Blender IPO animations can be exported into crystalspace. For the moment the IPOs supported are translation and rotation for thing, spr2d and genmesh, translation and RGB for lights.
Sequences are triggered when the sector they are in comes into view. In the future it will be possible to set up different kinds of triggers.
One of the Blender curve extend modes is supported: Cycle. Unless set the animation will only run once (the same as constant extend mode in blender). The same setting will be used for all the curves in an IPO, totally independent extend modes for curves will be implemented at some (remote) future time.
[edit] Rain and Snow
When a mesh type is set to rain or snow the mesh geometry won't be output, but a rain or snow field will be created with the cube bounds of the object.
Special care must be taken if rain or snow is wanted to rain downwards. The rain will by default "fall" in downwards direction in the object local coordinates. This means rotation must be applied in blender (crtl-A) or the rain will "fall" in unnatural direction (this can be useful for other kind of effects, like particles in a tunnel).
Default settings are to give snow the /lib/std/snow.jpg texture, and rain the /lib/std/raindrop.png texture, but if the overridematerial property is set to true user defined texture will be used (set through uv texturing on the object).
[edit] Snow Settings
-number, int: number of particles in the snow field. Default 1000
-dropsize, string: size of the particles (must be given in the form (x,y)). Default (0.07, 0.07)
-fallspeed, float: falling speed in object coordinates (this means unless you apply rotation to the object snow won't fall downwards). Default 0.3
-swirl, float: swirl for the particles. Default 0.2
-realfallspeed, string: speed given in three axis (must be given in the form (x,y,z)). Overrides fallspeed. Not selt by default
-color, string: color for the particles (must be given in the form (r,g,b)). Default (0.25,0.25,0.25)
-overridematerial, bool: whether to use normal texture for snow (/lib/std/snow.jpg) or user defined. Default no.
[edit] Rain Settings
-number, int: number of particles in the rain field. Default 500
-dropsize, string: size of the particles (must be given in the form (x,y)). Default (0.02, 0.37)
-fallspeed, float: falling speed in object coordinates (this means unless you apply rotation to the object snow won't fall downwards). Default 2.84
-realfallspeed, string: speed given in three axis (must be given in the form (x,y,z)). Overrides fallspeed. Not selt by default
-color, string: color for the particles (must be given in the form (r,g,b)) Default: (0.2,0.35,0.5)
-overridematerial, bool: whether to use normal texture for rain (/lib/std/raindrop.png) or user defined. Default no.
[edit] Exporting for CEL
Starting on version 0.4 it is now possible to generate worlds ready to be used with cel, and setting some properties related to entities and quests, as well as behaviours.
There are two tools prepared to ease the burden on assigning entity templates. The entity browser and the quest browser. The work in a quite straightforward way. Select the object. Select the entity or quest template file. Hit assign. New templates can be easily be build for experimentation.
For exporting maps prepared for cel the CEL button in the main section must be activated, then the exporter will also create a level.xml file, a entities file, and a world file. The export process is tailored for loading through a zonemanager entity, but the different files can be loaded independently (only world must be loaded prior to entities).
The most important property to take into account is the entity property. Setting this to true will export an entity to the "entities" file in addition to meshobjects and meshfactories that are normally output to the "world" file.
Some property classes are automatically assigned to entities depending on assigned properties.
-pcmesh will be assigned to all objects that carry a mesh.
-pcsolid will be assigned to all objects with the colldet property set (default)
-pcmeshselect will be assigned to all objects that carry a mesh.
-pclight will be assigned to lights with entity property set.
-pclinmove can be assigned by using the pclinmove property
-pctimer will be added with wakeup, wakeupnr and wakeupframe properties
-pctrigger will be added with trigger_sphere, trigger_above and anchor properties
-pcquest will be added when linking quests to entities using quest* properties
-pcmechsystem will be added to the sector depending on pcmechanics property in sectorsettings object.
-pcmechobject will be added to entities when dynamics property is set for the object
see below for a detailed description on all properties.
[edit] Entity Properties
-entity, bool: this property defines whether this object will export entity properties. it must be set to true for all objects that we want to be entities. Default: false
-entitytpl, string: the name of the entity template the entity will use. Default: Not set (not mandatory)
-entitytplfile, string: the full path to the file the entity template resides on. Default: Not set (not mandatory)
-pclinmove:, bool: defines wether the object must react to gravity and in general gives the object moving capabilities. When set the object will get a pclinearmovement property class. Default: False
-behaviour:, string: the behaviour the entity will respond to. Default: not set
-behaviourlayer:, string: the behaviourlayer the entity will use. Default: blpython
-quest*:, string: any property starting with quest will define a quest using the file specified as argument. The file must be in the b2cs/templates/quest/ folder in blender2crystal installation. The quest will be added to que questdef section in the sector, plus a pcquest pcproperty will be set for the entity, and will be passed parameters depending on previous properties.
[edit] Entity Helper Properties
this properties set many things at once for attaining high level behaviours directly
-anchor:, float: defines that the entity is an anchor. the value in the parameter is the distance on top of the object where the camera entity will be anchored. When set hiddenly adds a MovingPlatformAnchor quest to the object and a pctrigger for detecting when the camera is on top. Default: not set
[edit] Entity Wakeup Properties
properties related to pctimer property class
-wakeup:, float: a timer for the entity to wakeup. A pctimer pcproperty will be added to the entity. Default: not set
-wakeupnr:, float: a timer for the entity to wakeup. this timer will only work once. A pctimer pcproperty will be added to the entity. Default: not set
-wakeupframe:, bool: a timer for the entity to wakeup every frame. A pctimer pcproperty will be added to the entity. Default: False
[edit] Entity Trigger Properties
properties related to pctrigger property class
-trigger_sphere:, float: a trigger from a sphere around the entity center. When set will add a pctrigger propclass to the object. The value will be the radius for the trigger detection sphere. Default: not set
-trigger_above:, float: a trigger that will fire when the monitored entity is above this entity. When set will add a pctrigger propclass to the object. The value will be distance upward for the trigger detection area. Default: not set
[edit] Entity Mechanics Properties
If the sector has a mechsys then a pcmechsystem entity will be created for the sector. also if the sector has a dynamicsystem (dynsys property set) it will be used for the mechanic system (so the mechanic system will control the dynamic system).
Gravity for a sector can be set through the gravity property (as explained in sectorsettings section).
The properties for bodies are the same as general physics properties in the exporter (mass, density, elasticity, friction, softness). The general rule is a pcmechobject propclass will be exported for entities with dynamics set to true. A pcmechsystem will also be created automatically if it has not been specified in sectorsettings.
In sectorsettings object:
-mechsys:, string: will make the sector have a pcmechsystem entity where all pcmechobjects in the sector will be put. (will be created automatically if there are entities with dynamics set to true). The mechanic system will automatically reference any dynamic system in the sector as specified through dynsys property. Default: Not set
also gravity and dynsys are used for entity physics.
[edit] Entity quest properties
this properties result in certain parameters being sent to entity quests
-key:, string: an object to be used as key for some quest. it exports $key_ent to this entity quests so they can use them. Default: not set
-target:, string: an entity to be used as target for some quest. it exports $target_ent to this entity quests so they can use it. Default: not set
-op_on:, string: an operation to be done when activating a quest. it exports $target_op_on to this entity quests so they can use it. Default: light_on
-op_off:, string: an operation to be done when deactivating a quest. it exports $target_op_on to this entity quests so they can use it. Default: light_off
-activate_move:, float: the amount the entity should move when activating/deactivating a quest. it exports $on_distance and $off_distance to this entity quests. Default: 1
[edit] Available Entity templates
[edit] player.xml
an entity for the player. the object with this template should be called camera for the moment, as many quests have this name hardcoded. a solution for this limitation will be looked for in the future.
[edit] npc.xml
an entity for non player characters.
[edit] globalselection.xml
an entity template that should be set to an empty object in blender. it will allow moving entities around with the mouse.
[edit] Available Quest templates
[edit] pickable.xml
a quest for objects that can be picked from the ground. it works just by setting it.
[edit] MovingPlatformAnchor.xml
a quest for objects that can carry the camera around. it is automatically assigned by using the anchor property as explained above
[edit] SlideDoor*
a quest for doors that open when the player comes near. this quest should be used in conjunction with trigger_sphere to the define the radius for opening the door. activate_move will also affect this quest.
[edit] SlideDoorLocked*
like the before quests for doors that open on approaching, but this variant only opens when the player is carrying the key entity specified with key property.
[edit] ButtonLight
A quest for a light that can be switched on and off. It is automatically assigned to lights with entity set to true.
[edit] ButtonSeq*
a quest for buttons that can activate sequences in quests from other objects. there are several flavours for this quest, to set direction for the button. activate_move, target, op_on, op_off are valid properties for this quest that can be set in blender (see above). The defaults are set so it will automatically switch lights when setting target to a light, but different effects can be attained by using the properties.
Don't forget target entities must also be entities (i.e. they must have the entity property set to True).
[edit] Examples of use
Different effects can be attained by using the cel export mode. Some examples follow.
[edit] The player
The player can be set by assigning the player.xml template using the cel browser tool. also name must be set to "camera" or many quests would not respond to the user. Also pclinmove must be set to true or the entity will float in the air. Some bahaviour must be defined so the player actions can be programmed. Usually actor will be used as name for the behaviour.
[edit] A moving platform
Moving objects exported can be exported directly from blender animations. Cycle can be used to make the animation cycle in extrapolation mode, this means first and last key of the ipo must be equal if the object is wanted to translate between several key points. entity and anchor must be set to true so that the platform will carry the player around.
[edit] Pickable objects
By applying the pickable.xml quest from the quest browser any object can be made pickable.
[edit] Non player characters
The template npc.xml is specially designed for non player characters and should be used. Also pclinmove must be set to true or the entity will float in the air. Usually also some bahaviour will be defined so the entity will react to the environment.
[edit] Setting the globalselection entity
The globalselection.xml template is designed so by applying it to an empty object in blender it will make all objets draggable by clicking.

