Kanzi 3.9.5 migration guide

Use this migration guide to update Kanzi applications from Kanzi 3.9.4 to Kanzi 3.9.5.

Changes to mesh vertex data handling

When you load a Kanzi application on a target device that does not support half-float mesh vertex attributes, Kanzi no longer automatically converts vertex data from half-float to float.

If your target device does not support half-float vertex attributes, in Kanzi Studio set your mesh attributes to use the float data type. See Setting the optimal data type for mesh attributes.

Changes in text layout

Kanzi now applies the font hinting set in a font when it lays out text in Text Block and Text Box nodes. This slightly changes the positions of characters.

See Setting font hinting.

Changes to Light nodes

Removed the Light::EnabledProperty. Use the Node::VisibleProperty to control whether a light is on.

Deprecated these functions:

  • Light::isEnabled(). Use Node::isVisible() instead.

  • Light::setEnabled(). Use Node::setVisible() instead.

Kanzi Studio automatically converts projects, which have disabled light nodes, to use the Node::VisibleProperty.

Changes to 2D node geometry

Kanzi now uses shared static geometry for most 2D rendering. Geometries returned by these functions are not guaranteed to match the size of the rendered geometry:

  • NodeVisual2D::getForegroundGeometry()

  • NodeVisual2D::getBackgroundGeometry()

  • NodeCompositor2D::getBlitGeometry()

  • NodeCompositor2D::getClearGeometry()

To implement custom rendering of the foreground or background geometry using a custom brush, use the new NodeVisual2D::renderForeground() and NodeVisual2D::renderBackground() overloads that allow using a custom brush renderer.

To transform the foreground, background, blit, or clear geometry returned by NodeVisual2D or NodeCompositor2D to the local space of a node, use the transformation returned by these new local transformation getters:

  • NodeVisual2D::getForegroundLocalTransformation()

  • NodeVisual2D::getBackgroundLocalTransformation()

  • NodeCompositor2D::getBlitLocalTransformation()

  • NodeCompositor2D::getClearLocalTransformation()

Changes in support for Debug and Release build types for Kanzi Engine Java plugins

Starting with Kanzi Studio 3.9.5, the path of Kanzi Engine Java plugins must include lib/java/<BuildType>. For example:

  • For debug, <ProjectName>/Application/lib/java/Debug/<PluginName>.jar.

  • For release, <ProjectName>/Application/lib/java/Release/<PluginName>.jar.

If the Kanzi Java plugin file path does not include the plugin build configuration, Kanzi Studio issues this warning and does not import or update the plugin.

../../_images/java-plugin-import-warning-message.png

To migrate your Kanzi application:

  1. In the <ProjectName>/Application/configs/platforms/android_gradle/<PluginName>/build.gradle file replace

    destinationDir = file("${rootDir}/../../../lib/java")
    

    with

    destinationDirectory = file("${rootDir}/../../../lib/java/${buildType.name.capitalize()}")
    

    This way you set the correct path where the Gradle script of your plugin exports the JAR files.

  2. In Kanzi Studio, in the Library > Kanzi Engine Plugins, right-click each Kanzi Engine plugin and select Delete.

    ../../_images/java-plugin-remove.png
  3. In the Library > Kanzi Engine Plugins, right-click the name of the Kanzi Engine Java plugin and select Import Kanzi Engine Plugin. In File Explorer, select and import the JAR files. The path of Kanzi Engine Java plugins must include lib/java/<BuildType>. For example:

    • For debug, <ProjectName>/Application/lib/java/Debug/<PluginName>.jar.

    • For release, <ProjectName>/Application/lib/java/Release/<PluginName>.jar.

    ../../_images/java-plugin-import.png

Change to Kanzi Gradle plugin version

To migrate your Kanzi application, in the <ProjectName>/Application/configs/platforms/android_gradle/build.gradle file replace

classpath 'com.rightware.gradle:kanzi:0.6.2'

with

classpath 'com.rightware.gradle:kanzi:0.7.1'

Changes to Kanzi Engine plugin static registration code

The Kanzi Studio templates that create a project with a Kanzi Engine application now use the KANZI_CORE_API_IMPORT macro to determine whether to register plugin components statically or dynamically. Applications created with an earlier version of Kanzi register all plugin components statically by default.

To register plugin components dynamically in an application that you created with an earlier version of Kanzi, in the class that derives from the Application class, replace

#if !defined(ANDROID) && !defined(KANZI_API_IMPORT)

with

#if !defined(ANDROID) && !defined(KANZI_CORE_API_IMPORT)