00001 00002 /* 00003 TEDDY - General graphics application library 00004 Copyright (C) 1999-2002 Timo Suoranta 00005 tksuoran@cc.helsinki.fi 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 00021 $Id: LWSceneLight.cpp,v 1.1 2002/02/16 12:41:39 tksuoran Exp $ 00022 */ 00023 00024 00025 #include "Teddy/TeddyConfig.h" 00026 #if defined( TEDDY_INCLUDE_LW_SCENE ) 00027 00028 00029 #include "Teddy/Imports/LWSceneFile.h" 00030 #include "Teddy/Imports/LWSceneParser.h" 00031 #include "Teddy/Imports/LWLight.h" 00032 #include "Teddy/Imports/LWMotion.h" 00033 #include "Teddy/SysSupport/Messages.h" 00034 using namespace Teddy::Graphics; // Color 00035 using namespace Teddy::SysSupport; 00036 00037 00038 namespace Teddy { 00039 namespace Imports { 00040 00041 00042 /* 00043 AmbientColor <Red value> <Green value> <Blue value> 00044 00045 TIS: appears to use doubles in LWSC 3 00046 00047 example: AmbientColor 200 200 200 00048 00049 The AmbientColor function provides the RGB color values for the ambient 00050 lighting in the scene. 00051 00052 <value range>: Red value - 0 - 255 00053 Green value - 0 - 255 00054 Blue value - 0 - 255 00055 00056 */ 00057 void LWSceneParser::AmbientColor(){ 00058 double red = file->read_double(); 00059 double green = file->read_double(); 00060 double blue = file->read_double(); 00061 00062 ambient_color = Color( red, green, blue ); 00063 //ambient_color = Color( (float)red/255.0, (float)green/255.0, (float)blue/255.0 ); 00064 dmsg( M_LWS, "AmbientColor %f, %f, %f", red, green, blue ); 00065 } 00066 00067 00068 /* 00069 \todo envelope support 00070 00071 AmbientIntensity <percentage> ¦ (envelope) 00072 00073 example: AmbIntensity 0.250000 00074 00075 The AmbientIntensity function provides the intensity of the ambient light 00076 in the scene. The functions percentage value can be changed over time 00077 with an envelope. If an envelope is chosen, the functions value is 00078 replaced with an envelope identifier. 00079 */ 00080 void LWSceneParser::AmbientIntensity(){ 00081 amb_intensity = file->read_double(); 00082 dmsg( M_LWS, "AmbientIntensity %f", amb_intensity ); 00083 } 00084 00085 00086 void LWSceneParser::GlobalFlareIntensity(){ 00087 double global_flare_intensity = file->read_double(); 00088 } 00089 00090 00091 /* 00092 EnableLensFlares <flag> 00093 00094 example: EnableLensFlares 0 00095 00096 This function sets a global flag that enables/disables all lens flares 00097 in the scene. This function produces a listing only when disabled (0). 00098 00099 <flag>: 0 - Off 00100 1 - On (Default : No function listing) 00101 */ 00102 void LWSceneParser::EnableLensFlares(){ 00103 int e = file->read_int(); 00104 enable_lens_flare = e==1 ? true : false; 00105 } 00106 00107 00108 /* 00109 EnableShadowMaps <flag> 00110 00111 example: EnableShadowMaps 0 00112 00113 This function sets a global flag the enables/disables the calculation of 00114 shadow maps for all lights. This function produces a listing only when 00115 disabled (0). 00116 00117 <flag>: 0 - Off 00118 1 - On (Default: No function listing) 00119 */ 00120 void LWSceneParser::EnableShadowMaps(){ 00121 int e = file->read_int(); 00122 enable_shadow_maps = e==1 ? true : false; 00123 } 00124 00125 00126 /* 00127 AddLight 00128 00129 example: AddLight 00130 00131 The AddLight function is the first function in a light segment. 00132 It is called for each instance in a light in the scene file. 00133 */ 00134 void LWSceneParser::AddLight(){ 00135 current_object = current_light = new LWLight(); 00136 dmsg( M_LWS, "lights.insert( %d ) ...", next_light ); 00137 lights.insert( make_pair(next_light,current_light) ); 00138 dmsg( M_LWS, "lights.insert( %d ) done", next_light ); 00139 next_light++; 00140 } 00141 00142 00143 /* 00144 ShowLight <Refresh value> <Color value> 00145 00146 example: ShowLight 0 5 00147 00148 The ShowLight function determines how the light is going to be displayed 00149 in Layout. The above example would hide this bone until selected. If it 00150 were set to visible refresh, it would be purple. 00151 00152 Refresh value 00153 00154 This argument sets the lights display type in Layout. 00155 00156 <Refresh value>: 0 - No Refresh (Hide) 00157 1 - Refresh (Show) 00158 00159 User: This value is selected in the second column of the Scene Overview 00160 from the Scene Menu. 00161 00162 00163 Color value 00164 00165 This argument sets the color of the light in Layout 00166 00167 <Color value>: 1 - Blue 00168 2 - Green 00169 3 - Light Blue 00170 4 - Red 00171 5 - Purple 00172 6 - Orange 00173 7 - Gray 00174 00175 User: This value is selected in the first column of the Scene Overview 00176 from the Scene Menu. 00177 00178 */ 00179 void LWSceneParser::ShowLight(){ 00180 int refresh_value = file->read_int(); 00181 int color_value = file->read_int(); 00182 } 00183 00184 00185 /* 00186 LightName Light ¦ <string> 00187 00188 example: LightName HeadLight 00189 00190 This function provides a name for the light created with the AddLight 00191 function. If the user renames the light using the Rename Light function 00192 from the Light menu, the string is listed following the function name. 00193 If the user does not rename the light, it is given the default name of 00194 Light. If multiple light instances have the same name, duplicate light 00195 names are given a numbered suffix to the name during the loading/creation 00196 process. This number is enclosed in parenthesis and follows the light name. 00197 00198 An example: HeadLight (2) is the second instance of a HeadLight. The 00199 number is not saved in the scene file, and is used only as a user reference. 00200 */ 00201 void LWSceneParser::LightName(){ 00202 char *name = file->read_string(); 00203 current_object->setModelName( name ); 00204 } 00205 00206 00207 /* 00208 LightMotion (unnamed) 00209 00210 example: LightMotion (unnamed) 00211 00212 This is a light motion label for the keyframe information of the current 00213 light segment. It does not require any arguments to be passed to it. 00214 00215 The LightMotion identifier is listed with all light instances. 00216 */ 00217 void LWSceneParser::LightMotion(){ 00218 current_motion = new LWMotion(); 00219 current_object->setMotion( current_motion ); 00220 } 00221 00222 00223 /* 00224 LightColor <Red value> <Green value> <Blue value> 00225 00226 TIS: Appears to use doubles in LWSC 3 00227 00228 example: LightColor 200 200 150 00229 00230 The LightColor function provides the RGB color values for the light that 00231 is cast from the current light source. 00232 00233 <value range>: Red value - 0 - 255 00234 Green value - 0 - 255 00235 Blue value - 0 - 255 00236 */ 00237 void LWSceneParser::LightColor(){ 00238 double red = file->read_double(); 00239 double green = file->read_double(); 00240 double blue = file->read_double(); 00241 current_light->setColor( red, green, blue ); 00242 } 00243 00244 00245 /* 00246 LightType <value> 00247 00248 example: LightType 0 00249 00250 The LightType function provides type of light source for the current 00251 light instance. 00252 00253 <value>: 0 - Distant 00254 1 - Point 00255 2 - Spot 00256 ? 3 - Linear 00257 ? 4 - Area 00258 00259 User: This function's value is chosen from the Light Type selections 00260 on the Lights Panel. 00261 */ 00262 void LWSceneParser::LightType(){ 00263 int light_type = file->read_int(); 00264 current_light->setType( light_type ); 00265 } 00266 00267 void LWSceneParser::LightFalloffType(){ 00268 int light_falloff_type = file->read_int(); 00269 current_light->setFalloffType( light_falloff_type ); 00270 } 00271 00272 void LWSceneParser::LightRange(){ 00273 double light_range = file->read_double(); 00274 current_light->setRange( light_range ); 00275 } 00276 00277 /* 00278 LightConeAngle <angle> ¦ (envelope) 00279 00280 example: LightConeAngle 30.000000 00281 00282 The LightConeAngle function provides the degree angle of the light cone 00283 projected from the current light source. This function only applies 00284 to Spot Lights (LightType 2). This function's angle can be fluctuated 00285 over time with an envelope. If an envelope is chosen, the functions 00286 value is replaced with an envelope identifier. 00287 00288 User: This function is set from the SpotLight Cone Angle field on the 00289 Lights Panel. 00290 */ 00291 void LWSceneParser::LightConeAngle(){ 00292 double cone_angle = file->read_double(); 00293 current_light->setConeAngle( cone_angle ); 00294 } 00295 00296 /* 00297 \todo support envelope 00298 00299 LightEdgeAngle <angle> ¦ (envelope) 00300 00301 example: LightEdgeAngle 5.000000 00302 00303 The LightEdgeAngle function provides the degree angle for the soft edge of 00304 the light cone projected from the current light source. This function 00305 only applies to SpotLights (LightType 2). This function's angle can be 00306 fluctuated over time with an envelope. If an envelope is chosen, the 00307 function's value is replaced with an envelope identifier. 00308 00309 User: This functions value is set from the Spot Soft Edge Angle field 00310 on the Lights Panel. 00311 */ 00312 void LWSceneParser::LightEdgeAngle(){ 00313 double edge_angle = file->read_double(); 00314 current_light->setEdgeAngle( edge_angle ); 00315 } 00316 00317 00318 /* 00319 LightIntensity <percentage> ¦ (envelope) 00320 00321 example: LgtIntensity 0.750000 00322 00323 This function provides the intensity of the current light source as a 00324 percentage value. This is equivalent to the "brightness of the light 00325 source". The intensity value can go above 100%. The function's value 00326 can be changed over time with an envelope. If an envelope is chosen, 00327 the functions value is replaced with an envelope identifier. 00328 00329 User: This function is set from the Light Intensity field on the Lights 00330 Panel. 00331 */ 00332 void LWSceneParser::LightIntensity(){ 00333 double light_intensity = file->read_double(); 00334 current_light->setIntensity( light_intensity ); 00335 } 00336 00337 /* 00338 Falloff <percentage> ¦ (envelope) 00339 00340 example: Falloff 0.350000 00341 00342 The Falloff function provides the percentage of light intensity falloff 00343 per meter. This function is only used by Point (LightType 1) and 00344 Spot (LightType 2) lights. This function's percentage can be fluctuated 00345 over time with an envelope. If an envelope is chosen, the functions value 00346 is replaced with an envelope identifier. 00347 00348 User: This function is set from the Intensity Falloff field on the 00349 Lights Panel. 00350 */ 00351 void LWSceneParser::Falloff(){ 00352 double falloff = file->read_double(); 00353 current_light->setFalloff( falloff ); 00354 } 00355 00356 void LWSceneParser::AffectCaustics(){ 00357 int affect_caustics = file->read_int(); 00358 current_light->setAffectCaustics( affect_caustics ); 00359 } 00360 void LWSceneParser::AffectDiffuse(){ 00361 int affect_diffuse = file->read_int(); 00362 current_light->setAffectDiffuse( affect_diffuse ); 00363 } 00364 void LWSceneParser::AffectSpecular(){ 00365 int affect_specular = file->read_int(); 00366 current_light->setAffectSpecular( affect_specular ); 00367 } 00368 void LWSceneParser::AffectOpenGL(){ 00369 int affect_opengl = file->read_int(); 00370 current_light->setAffectOpenGL( affect_opengl ); 00371 } 00372 00373 00374 /* 00375 UseConeAngle <flag> 00376 00377 example: UseConeAngle 1 00378 00379 This flag determines whether the shadow map will use the light's cone 00380 angle or a separate angle for the shadowmap calculations. If the flag 00381 is turned off, an additional function listing for ShadowMapAngle is produced. 00382 00383 <flag> 0 - Use angle from ShadowMapAngle 00384 1 - Use Cone Angle 00385 */ 00386 void LWSceneParser::UseConeAngle(){ 00387 int select = file->read_int(); 00388 current_light->setUseConeAngle( select ); 00389 } 00390 00391 00392 /* 00393 LensFlare <flag> 00394 00395 example: LensFlare 1 00396 00397 This flag turns the LensFlare function on. This function produces a 00398 LensFlare listing with a value of 1 and additional function listings 00399 when turned on. When turned off, this function does not produce a 00400 listing in the scene file. 00401 00402 User: This function is activated from the Lens Flare check box on the 00403 Lights Panel. 00404 */ 00405 void LWSceneParser::LensFlare(){ 00406 int select = file->read_int(); 00407 current_light->setLensFlare( select ); 00408 } 00409 00410 00411 /* 00412 \todo support envelope 00413 00414 Additional: FlareIntensity <percentage> ¦ (envelope) 00415 00416 example: FlareIntensity 0.750000 00417 00418 This function provides the intensity/size of the lens flare. 00419 The intensity can be fluctuated with an envelope. 00420 00421 User: This function's value is set in the Flare Intensity field 00422 from the Lens Flare Options Panel. 00423 */ 00424 void LWSceneParser::FlareIntensity(){ 00425 double flare_intesity = file->read_double(); 00426 current_light->setFlareIntensity( flare_intesity ); 00427 } 00428 00429 00430 /* 00431 \todo support envelope 00432 00433 Additional: FlareDissolve <percentage> ¦ (envelope) 00434 00435 example: FlareDissolve 0.350000 00436 00437 This function provides the percentage of dissolve of the current 00438 light's lens flare. The dissolve can be fluctuated with an envelope. 00439 00440 User: This function's value is set on the Flare Dissolve field 00441 from the Lens Flare Options Panel. 00442 */ 00443 void LWSceneParser::FlareDissolve(){ 00444 double flare_dissolve = file->read_double(); 00445 current_light->setFlareDissolve( flare_dissolve ); 00446 } 00447 00448 00449 /* 00450 Additional: LensFlareFade <bit-field value> 00451 00452 example: LensFlareFade 4 00453 00454 This function determines the fade options for the current light's 00455 lens flare. 00456 00457 The value is produced by calculating the decimal value of a 5 position 00458 bit-field whose bits represent logical on/off switches that are 00459 numbered left to right from 0 - 4. The field's least-significant bit 00460 is the rightmost bit. Each lens flare fade option has a corresponding 00461 bit in this bit-field. When an option is selected, it's bit (or 00462 switch) is turned on. 00463 00464 <bit position>: 0 - RESERVED 00465 1 - Fade With Distance 00466 2 - Fade Off Screen 00467 3 - Fade Behind Objects 00468 4 - Fade In Fog 00469 */ 00470 void LWSceneParser::LensFlareFade(){ 00471 int lens_flare_fade = file->read_int(); 00472 current_light->setLensFlareFade( lens_flare_fade ); 00473 } 00474 00475 00476 /* 00477 Additional: LensFlareOptions <bit-field value> 00478 00479 example: LensFlareOptions 85 00480 00481 This function provides the flare settings for the current light's 00482 lens flare. 00483 00484 The value is produced by calculating the decimal value of a 10 position 00485 bit-field whose bits represent logical on/off switches that are 00486 numbered left to right from 0 - 9. The field's least-significant 00487 bit is the rightmost bit. Each lens flare option has a corresponding 00488 bit in this bit-field. When an option is selected, it's bit (or 00489 switch) is turned on. 00490 00491 <bit positions>: 0 - Central Glow + Red Outer Glow 00492 1 - Central Ring 00493 2 - Star Filter 00494 3 - Random Streaks 00495 4 - Lens Reflections 00496 5 - Suppress Red Outer Glow 00497 6 - Anamorphic Distort 00498 7 - Anamorphic Streaks 00499 8 - Off Screen Streaks 00500 9 - Glow Behind Objs 00501 00502 */ 00503 void LWSceneParser::LensFlareOptions(){ 00504 int lens_flare_options = file->read_int(); 00505 current_light->setLensFlareOptions( lens_flare_options ); 00506 } 00507 00508 00509 /* 00510 Additional: FlareRandStreakInt <percentage> 00511 00512 example: FlareRandStreakInt 0.030000 00513 00514 The FlareRandStreakInt function provides the percentage of intensity 00515 for the current light's random streaks. 00516 */ 00517 void LWSceneParser::FlareRandStreakInt(){ 00518 double flare_rand_streak_int = file->read_double(); 00519 current_light->setFlareRandStreakInt( flare_rand_streak_int ); 00520 } 00521 00522 00523 /* 00524 Additional: FlareRandStreakDens <float> 00525 00526 example: FlareRandStreakDens 0.500000 00527 00528 The FlareRandStreakDens function provides a floating point value for 00529 the density of the current light's lens flare random streaks. 00530 00531 */ 00532 void LWSceneParser::FlareRandStreakDens(){ 00533 double flare_rand_streak_dens = file->read_double(); 00534 current_light->setFlareRandStreakDens( flare_rand_streak_dens ); 00535 } 00536 00537 00538 /* 00539 Additional: FlareRandStreakSharp <float> 00540 00541 example: FlareRandStreakSharp 0.060000 00542 00543 The FlareRandStreakSharp function provides a floating point value 00544 for the density of the current light's lens flare random streaks. 00545 */ 00546 void LWSceneParser::FlareRandStreakSharp(){ 00547 double flare_rand_streak_sharp = file->read_double(); 00548 current_light->setFlareRandStreakSharp( flare_rand_streak_sharp ); 00549 } 00550 00551 00552 void LWSceneParser::ShadowType(){ 00553 int shadow_type = file->read_int(); 00554 current_light->setShadowType( shadow_type ); 00555 } 00556 00557 00558 /* 00559 ShadowCasting <value> 00560 00561 example: ShadowCasting 7 00562 00563 The ShadowCasting function determines what type of shadows the current 00564 light is going to produce during the rendering process. This function 00565 chooses the type of shadow rendering, but it does not initiate the 00566 process. Additional functions must be activated to turn the shadowing 00567 process on. For Raytrace Shadows, the Camera function, RayTraceEffects 00568 must include the TraceShadows option. For ShadowMap Shadows the Light 00569 function: EnableShadowMaps must be set to 1. 00570 00571 <value>: 0 - No Shadows 00572 1 - Raytrace Shadows 00573 2 - ShadowMap Shadows 00574 00575 */ 00576 void LWSceneParser::ShadowCasting(){ 00577 int shadow_casting = file->read_int(); 00578 current_light->setShadowCasting( shadow_casting ); 00579 } 00580 00581 00582 /* 00583 ShadowMapSize <int> 00584 00585 example: ShadowMapSize 512 00586 00587 The ShadowMapSize function sets the amount of memory, in bytes, that the 00588 current light is going to allocate for it's shadow map calculations. 00589 A higher memory size will result in a smoother shadow map. 00590 */ 00591 void LWSceneParser::ShadowMapSize(){ 00592 int shadow_map_size = file->read_int(); 00593 current_light->setShadowMapSize( shadow_map_size ); 00594 } 00595 00596 00597 /* 00598 additional: ShadowMapAngle <angle> 00599 00600 example: ShadowMapAngle 0.450000 00601 00602 This function provides the angle for the shadow map calculations 00603 if the UseConeAngle function is turned off. 00604 */ 00605 void LWSceneParser::ShadowMapAngle(){ 00606 double shadow_map_angle = file->read_double(); 00607 current_light->setShadowMapAngle( shadow_map_angle ); 00608 } 00609 00610 00611 /* 00612 ShadowFuzziness <float> 00613 00614 example: ShadowFuzziness 1.000000 00615 00616 The ShadowFuzziness function provides a floating point value for the edge 00617 softness of the current light's shadow map calculations. 00618 */ 00619 void LWSceneParser::ShadowFuzziness(){ 00620 double shadow_fuzziness = file->read_double(); 00621 current_light->setShadowFuzziness( shadow_fuzziness ); 00622 } 00623 00624 00625 }; // namespace Imports 00626 }; // namespace Teddy 00627 00628 00629 #endif // TEDDY_INCLUDE_LW_SCENE 00630 00631 00632 /* 00633 Chapter 4: LIGHT SECTION 00634 00635 00636 4.1 LIGHT SECTION INFORMATION 00637 00638 00639 4.1.1 Light Section Description 00640 00641 00642 The Light Section contains all of the information that pertains to the 00643 lights in a LightWave scene. 00644 00645 LightWave loads and lists all lights in the order in which they appear 00646 in the scene file. 00647 00648 Duplicate light names are given a numbered suffix during the loading 00649 process. This number is enclosed in parenthesis and follows the light 00650 name. An example: HeadLight (3) is the third instance of the light 00651 name HeadLight. The number is not saved in the scene file, and is 00652 used only as a user reference. 00653 00654 The Target and Parent functions use a value that is equal to the order 00655 in which the referenced object was loaded in the scene. i.e. The value 00656 in the function ParentObject 3 means that the current light is parented 00657 to the third object instance in the scene file. 00658 00659 00660 00661 4.1.2 Individual Light Segment 00662 00663 00664 Preceding Scene and Object sections...... 00665 00666 AmbientColor 255 255 255 00667 AmbIntensity 0.250000 00668 AddLight 00669 LightName Light 00670 ShowLight 0 7 00671 LightMotion (unnamed) 00672 9 00673 1 00674 0 0 0 60 30 0 1 1 1 00675 0 0 0 0 0 00676 EndBehavior 1 00677 LightColor 255 255 255 00678 LgtIntensity 1.000000 00679 LightType 2 00680 FallOff 0.000000 00681 ConeAngle 30.000000 00682 EdgeAngle 5.000000 00683 ShadowCasting 1 00684 00685 Additional Scene Listings....... 00686 00687 00688 00689 4.2 LIGHT FUNCTIONS 00690 00691 00692 4.2.1 Function Order 00693 00694 The following is a list of light functions that are listed in the order 00695 in which they appear in the scene file. 00696 00697 00698 Functions denoted with an asterisk (*) are required for all light 00699 loading instances. 00700 00701 Italicized entries denote function labels and not true function names. 00702 00703 Indented entries denote an optional function of the preceding function. 00704 00705 Optional functions will produce a listing only when activated by the 00706 user. 00707 00708 AmbientColor * 00709 AmbIntensity * 00710 GlobalFlareIntensity (envelope) 00711 EnableLensFlare 00712 EnableShadowMaps 00713 AddLight * 00714 LightName * 00715 ShowLight * 00716 LightMotion (identifier) * 00717 Number of Information Channels * 00718 Number of Keyframes * 00719 Keyframe Information * 00720 EndBehavior * 00721 LockedChannels 00722 ParentObject 00723 TargetObject 00724 LightColor * 00725 LgtIntensity * 00726 LightType * 00727 Falloff (Point & Spot only) 00728 ConeAngle (Spot only) 00729 EdgeAngle (Spot only) 00730 LensFlare 00731 FlareIntensity 00732 FlareDissolve 00733 LensFlareFade 00734 LensFlareOptions 00735 FlareRandStreakInt 00736 FlareRandStreakDens 00737 FlareRandStreakSharp 00738 ShadowCasting * 00739 ShadowMapSize (Spot only w/ Shadow Map) 00740 UseConeAngle (Spot only w/ Shadow Map) 00741 ShadowMapAngle 00742 ShadowFuzzines (Spot only w/ Shadow Map) 00743 00744 00745 00746 4.2.2 Function Descriptions 00747 00748 The following functions are listed in the order in which they appear in 00749 the scene file. 00750 00751 AmbientColor and AmbientIntensity are functions that are called once to 00752 set up the ambient lighting in a scene. GlobalFlareIntensity, 00753 EnableLensFlare, and EnableShadowMaps are all global functions that 00754 effect all lights in a LightWave scene. They are also called just once. 00755 00756 Beginning with AddLight, all functions following can be called for each 00757 light instance in a scene file. 00758 */ 00759 00760 00761 /* 00762 00763 GlobalFlareIntensity (envelope) 00764 00765 The GlobalFlareIntensity function provides an envelope to fluctuate the 00766 intensity of all lens flares in the scene at the same time. This function 00767 does not have the option for a single percentage, it is adjusted only 00768 through an envelope. 00769 */ 00770 00771 00772 /* 00773 LightMotion (unnamed) 00774 00775 example: LightMotion (unnamed) 00776 00777 This is a light motion label for the keyframe information of the current 00778 light segment. It does not require any arguments to be passed to it. 00779 00780 The LightMotion identifier is listed with all light instances. 00781 00782 00783 Number of Information Channels: <9> 00784 00785 This is a numeric value with no header that follows the LightMotion 00786 identifier. The value for the number of information channels is equal 00787 to the number of variables to be provided per keyframe. For LightWave 00788 keyframes, the variables are listed as follows: X position, Y position, 00789 Z position, Heading, Pitch, Bank, X Scale, Y Scale, and Z Scale. For 00790 light motions, the number of information channels value is automatically 00791 set to 9 by LightWave. The user has no access to this value. 00792 00793 The number of information channels is listed with all light instances. 00794 00795 00796 Number of Keyframes: <int> 00797 00798 This is a numeric value with no header that follows the Number of 00799 Information Channels. This value provides the number of keyframes for 00800 the current light. It is immediately followed by the keyframe information. 00801 Every light instance will have at least one keyframe at frame 0. 00802 00803 00804 The Number of Keyframes is listed with all light instances. 00805 00806 00807 Keyframe Information: 00808 00809 -1.321534 2.235439 2.164330 -60.000000 360.000000 180.000000 00810 1.0 1.0 1.0 15 0 1.0 0.0 0.0 00811 00812 The values are listed as follows: 00813 00814 1st Line: 00815 00816 XPosition, YPosition, ZPosition, Heading, Pitch, Bank 00817 00818 2nd Line: 00819 00820 XScale, YScale, ZScale, Frame Number, Linear Value, Tension, Continuity, Bias 00821 00822 At least one keyframe (frame 0) is listed for each light. 00823 00824 (See Section 1.3 Keyframes) 00825 */ 00826 00827 /* 00828 00829 EndBehavior <value> 00830 00831 example: EndBehavior 2 00832 00833 The EndBehavior function determines how the light will react when the 00834 last keyframe has been reached. The available choices are: reset, stop 00835 and repeat. The default setting is stop. 00836 00837 <value>: 0 - Reset 00838 1 - Stop (Default) 00839 2 - Repeat 00840 00841 User: This value is set from the light's motion graph panel. 00842 00843 The EndBehavior option is listed with all lights. 00844 00845 */ 00846 00847 /* 00848 LockedChannels <bit-field value> 00849 00850 example: LockedChannels 4093 00851 00852 This function determines the extent of the mouse control from LightWave's 00853 Layout. Separate independent channels of motion, rotation, etc. can be 00854 locked off to restrict the mouse's control on each channel. The mouse 00855 functions that it can effect are: Move (X,Y,Z), Rotate(H,P,B), 00856 Scale/Stretch(X,Y,Z), and RestLength(X,Y,Z). 00857 00858 The value is produced by calculating the decimal value of a 6 position 00859 bit-field whose bits represent logical on/off switches that are numbered 00860 left to right from 0 to 5. The least significant bit for this field is 00861 the rightmost bit. Each channel has a corresponding bit in the bit-field. 00862 When a channel is locked, it 's bit (or switch) is turned on. 00863 00864 <bit positions>: 0 - Move X 00865 1 - Move Y 00866 2 - Move Z 00867 3 - Rotate Heading 00868 4 - Rotate Pitch 00869 5 - Rotate Bank 00870 00871 User: This function is set from the Layout mouse control area. 00872 */ 00873 00874 /* 00875 00876 ParentObject <object instance> 00877 00878 example: ParentObject 4 00879 00880 This function provides LightWave with the current lights parent object 00881 in the hierarchical chain. The value is equal to the parent objects 00882 position in the loading/creation sequence. The example function would 00883 parent the current light to the fourth object instance in the scene file. 00884 When the ParentObject function is active, all keyframe information for 00885 the light becomes an offset from the parents information. 00886 00887 */ 00888 00889 /* 00890 TargetObject <object instance> 00891 00892 example: TargetObject 3 00893 00894 This function provides LightWave with the current lights target object 00895 in the scene. The value is equal to the target object's position in the 00896 loading/creation sequence. The example function would target the current 00897 light to the fourth object instance in the scene file. 00898 00899 */ 00900 00901 00902 00903