LScript v2.6 Patch Release Notes

v2.6.1 | v2.6.2 | . | . | . | .

patch: v2.6.1 | released: LightWave 7.5c

Bug Fixes

      The index validation code for the generalopts[] array was excluding the last element
      ([7]) in the array.
      Run-time parsing code would begin producing processing delays that were somewhat
      logarithmically proprotional to the number of lines of code in the compiled script.
      It manifested at a certain script size (the start of the upward curve of the
      logarithmic line), and load times would gradually increase thereafter.
      Due to their storage and retrieval from binary disc files, the 'true' and 'false'
      constant values were not always being evaluated correctly in the run-time
      environment.
      Tab page selections made prior to posting a Requester were being overridden and
      initialized to the first page in the reqpost() code.
      The Displacement Object Agent's 'source' data member was being hidden by a break in
      the program's logic flow.
      The watchdog mechanism used to prevent infinite recursion in refresh callbacks
      (activated when setvalue() is called for a control while in that control's active
      refresh UDF) was somehow broken during v2.6 development.  This has been corrected.
      Single-element return values (usually 'nil') applied to associative assignments would
      generate an "illegal assignment type" error message.  Now in such cases all assignment
      variables are simply left with their initialized 'nil' values and no error is
      generated.
      Assignment of sub-arrays to array elements, for example:

            PolysPoints[i][5] = polyinfo(PolyNum[i]);

      were not being marked as the correct type on assignment.  This left them vulnerable
      to the LScript garbage collector, causing the arrays to be reclaimed and cleared at
      the end of the assignment statement.
      The ctlgroup() functionality, apparently long broken, has been fixed.
      Script re-entrancy would be a problem when a redraw callback returned control to
      Layout while it was processing (for instance, when an info() call was made to
      pause script execution).  Re-entrancy during this situation is now watched for,
      and avoided.
      Attempting to display a PointID in Layout using info() (or warn() or error()) would
      result in a crash.
      Some existing compiled Modeler LScripts could experience problems with the way
      the automattic points[] and polygons[] arrays are now managed by the LScript
      engine.  This problem would most often manifest as the "attempt to access undeclared
      array ..." error message.

      Code has been added to trap this condition when loading compiled scripts and to
      fix up their references to these arrays.
      Negative numbers in the "Days until expiration" and "Usage count" fields of the
      LScript compiler interface were not being disallowed.
      The new binary() function would not return documented results when the maximum
      bit size in the second argument matched the number of bits in an integer (i.e.,
      [sizeof(int) * 8] on any platform).
      The Scene Object Agent's animfilename data member was incorrectly mapped to the
      current scene's name.
      The recovery password and expiration message controls of the Modeler LScript compiler
      interface were never enabled.
      Vector values would not display properly with the info()/warn()/error() functions.
      A temporary script structured employed by the Modeler LScript compiler was not being
      clear upon creation, leaving all of its data members in an undefined state.  This
      could manifest as odd errors in both the compile and the resulting compiled file.
      The Modeler setlayer() and setblayer() functions could cause memory overruns if the
      number of layers specified (in an array) exceeded a certain count.
      The Modeler LScript compiler was not properly initializing values in a temporary
      script structure used during compiling.  This could cause random problems with both
      the compile and the resulting compiled script.
      The automated handling of the change of object identifiers was checking for a false
      condition, leading in some states to a bypass of the update.
      Cross-platform path conversion code in LScript has been re-worked to more accurately
      fit literal path strings in the script to the platform where they are used.
      The reqposition() function was mistakenly using the provided X value for both X and
      Y position.
      The application of run-time identifier construction to array referencing, i.e.:

            save_type`current_expr[i] = ...

      was broken.
      Sequential variable handling in the LScript pre-processor failed to generate the correct
      names when base names included an underscore charaacter ('_').
      Compiled LScripts that used store() and recall() would sometimes fail to restore saved
      values until other scripts were first executed.
      Activating the debugger in a Shader's process() function caused re-entrancy problems,
      often resulting in a crash of the application.  This condition has been trapped, and
      subsequent calls to process() while the debugger is active are discarded.  Be aware
      that activating the debugger will likely generate incorrect results in the output
      of the shader script (i.e., the resulting image will not be shaded correctly) due
      to the discarded calls.
      The RenderThreads() function was not correctly filtering the provided integer values to
      ensure that they matched what Layout was expecting.
      Unterminated multi-line comments would crash the application; now an error message is
      generated.
      An internal token used to represent the foreach() iterator had some extra settings added
      to the compiled file format in LScript v2.6.  However, the run-time building code was not
      checking the version of the file format, and problems were occurring when this internal
      token was processed in previous versions.  This usually manifested as an "internal
      inconsistency" error when scripts compiled with older versions of the LScript compiler
      were run with v2.6 or higher.

Behavioral Changes

      Informational popups generated in Layout with info()/warn()/error() no longer consumes
      the first message slot with the identification of the script that is posting the
      message.  Instead, the name of the script is now appended to the title of the window,
      leaving both message slots available to the script.
      The ctlpopup() control now has the ability to generate its contents dynamically.  By
      specifying the name of a UDF as the third argument instead of an array-type value,
      the popup will query the indicated UDF for the contents of the popup each time the
      list is displayed.

            ...
            ctl[EXPRLST_CTL] = ctlpopup("Expressions",1,"popup_expr_list");
            ...

      The callback UDF should return one or more strings, either individually or as an
      array reference.

            ...
            popup_expr_list
            {
                return(expr_list);  // expr_list[] is constructed elsewhere in the script
            }
            ...
      In order to allow scripts to be more flexible in handling changes in the environment,
      two methods have been added to the Object Agents that manage information for Scene
      object.

      isValid() will cause the object identifier cached in the Object Agent to be validated
      against those objects in the Scene.  If the object identifier is no longer valid, then
      Boolean false is returned.

      isOriginal() will indicate whether the underlying object identifier has been changed
      by some event in the Scene (typically object loading or removal).  If Boolean true is
      returned, then the object identifier has not changed since the Object Agent was
      created.
      The pack() method now also handles associative arrays.  Any keys whose elements are
      'nil' will be removed from the array.

LScript Editor v1.3 Patch Release Notes

v1.3.1 | . | . | . | . | .

patch: v1.3.1 | released: LightWave 7.5c

      Text files that did not end with a newline character caused the editor to improperly
      terminate the final line of the file.
      Incoming text lines whose size exactly matched the length of the initial buffer
      allocation for them would not trigger a required expansion of the buffer, leading to
      memory overruns and random wonkiness (usually intermittent crashes).

Interface Designer v1.3 Patch Release Notes

v1.3.2 | . | . | . | . | .

patch: v1.3.2 | released: LightWave 7.5c

      Generation of Requester separator code was not using the correct temporary
      variable in the ctlposition() call.

Expressions Patch Release Notes

patch: ? | released: LightWave 7.5c

      The Mesh() constructor was not functioning properly when used in an LScript
      library file.

patch: v2.6.2 | released: LightWave 7.5d

Bug Fixes

      The getdir() function was incorrectly stripping the trailing slash from paths that
      point at the root drive under Windows.  This had the effect of making an absolute
      path relative, leaving the working directory whatever was current on that drive.
      The File() constructor was erroneously adding a leading colon to provided path
      names on the Mac.
      The SchematicPosition() CS function was incorrectly converting provided numeric values
      into whole integers before applying them to the schematic view.
      Countdown reminders in compiled files were not being displayed when scripts were
      loaded and activated as regular plug-ins.
      The keys() method was not returning a 'nil' value when all elements in an associative
      array were cleared by the pack() method.
      The active data member of the Control Object Agent was not being recognized as
      valid.
      The matchdirs() command was miscounting found subdirectories on the Mac, resulting
      in a nil return value.
      The setValue() method of the Texture Layer Object Agent was not processing the provided
      argument correctly for the TXLRIMAGE mode.  It would result in incorrect images being
      applied, or even an application crash.
      Arguments to the TXTAG_WREPEAT and TXTAG_HREPEAT modes of the Texture Layer Object
      Agent setValue() method were not being retrieved from the correct memory location.  This
      resulted in an error message about the provided argument's type.
      When using a Surface Object Agent's setValue() function when that Surface had a name
      that contained spaces, a crash of the application could result.
      Multiple-element assigments to the 'this' pointer were using an uninitalized variable reference.
      This problem was reported by a compiler warning, and has not appeared to manifest in any way
      during script execution.
      Transparency colors specified when creating a Glyph were not being processed correctly, resulting
      in no transparency happening at all.

Behavioral Changes

      System messages generated when the LightWave alert level is set to Expert are now
      channelled back to the interface's message area instead of displaying in an
      independent window.
      The pre-processor @if directive now recognizes a running_under token that can be
      matched against one of LAYOUT, MODELER or SCREAMERNET.
      There was no way in which a script could access a surface qualified by its referencing
      object (it could just access surfaces in the "pool" of surface names).  This could
      invariably cause problems when two or more objects were loaded that referenced the same
      (uninstanced) surface name.  Instead of returning 'nil', the Surface() constructor's
      surface-creation mode has been modified to return a Surface Object Agent for a specified
      surface if it already exists in the object's references.