Kanzi 3.8 migration guide¶
Use this migration guide to update Kanzi applications from Kanzi 3.7 to Kanzi 3.8.
Transitions between states without animations¶
In a State Manager when you use transitions that do not have an animation, in Kanzi 3.8 the State Manager sends the Transition Started and Transition Finished messages. If your application relies on not receiving these messages, when you upgrade your application to Kanzi 3.8, modify your application to take into account this change in the functionality.
Changes to skinned meshes¶
If in your Kanzi application you use skinned meshes, when migrating your application to Kanzi 3.8, update mesh data and transformations of skeleton nodes.
To update only the required items in the Library and keep the values of existing properties, merge the skinned meshes from an fbx or a dae file:
In the Library > Resource Files > 3D Assets right-click a skinned mesh and select Merge 3D Asset File. See Merging 3D assets.
In the Merge tool:
Select the check box next to the skinned mesh.
This way you update the mesh data.
Select the skeleton nodes whose transformations differ from those in the existing Kanzi Studio project.
In the Merge tool click Resolve to source and then click Merge.
After merging make sure that your changes to the nodes, such as added properties and modified values, in the imported Scene node, remain the same.
In the vertex shader of the material that you use for the skinned mesh that you merged replace the part of the shader that calculates skinning with the code that works in Kanzi 3.6.8 and in the Shader Source Editor click Save.
For example, replace
localToSkinMatrix = kzWorldMatrix * localToSkinMatrix; vec4 positionWorld = localToSkinMatrix * vec4(kzPosition.xyz, 1.0); vViewDirection = positionWorld.xyz - kzCameraPosition; vec4 Norm = mat4(localToSkinMatrix[0], localToSkinMatrix[1], localToSkinMatrix[2], vec4(0.0, 0.0, 0.0, 1.0)) * vec4(kzNormal.xyz, 0.0); vN = normalize(Norm.xyz); gl_Position = kzProjectionCameraWorldMatrix * vec4(positionWorld.xyz, 1.0);
with
mat4 localToWorldMatrix = kzWorldMatrix * localToSkinMatrix; vec4 positionWorld = localToWorldMatrix * vec4(kzPosition.xyz, 1.0); vViewDirection = positionWorld.xyz - kzCameraPosition; vec3 V = normalize(vViewDirection); vec4 Norm = mat4(localToWorldMatrix[0], localToWorldMatrix[1], localToWorldMatrix[2], vec4(0.0, 0.0, 0.0, 1.0)) * vec4(kzNormal.xyz, 0.0); vN = normalize(Norm.xyz); gl_Position = kzProjectionCameraWorldMatrix * localToSkinMatrix * vec4(kzPosition.xyz, 1.0);
Hardware key handling changes¶
To handle hardware key input, you must use key manipulators. In Kanzi 3.8 and Key Up messages are replaced with the Key Pressed and Key Released messages.
When you open your project in Kanzi Studio, Kanzi Studio automatically converts projects that use Key Down and Key Up messages with Key Pressed and Key Released messages and adds a Key Manipulator trigger to the node of the message with the key present in the condition. However, Kanzi Studio automatically converts only the Key Down and Key Up messages that use equality sign in their conditions. If in conditions of these message you use operations other that equality, you must manually convert all such key manipulators.
Focus changes¶
The Screen node is no longer a focus scope that provides focus chain navigation functionality. To use focus chain navigation in your project:
Set either the first node under the Screen node or a node where you want to use focus navigation, to be a focus group or a focus fence
Enable the Focusable property for that node.
See Focus.
Font changes¶
Renamed the
Fontclass toFontRuntime, which now also holds the font style. As a result of this,TextFormat,TextLayouter, andTextShapernow takeFontRuntimeinstead ofFont.Removed the
Node::FontPropertyand replaced its functionality with:Node::FontFamilyPropertyFontStyleConcept::WeightPropertyFontStyleConcept::StyleProperty
Moved and renamed these properties from the
TextBlockConceptto theFontStyleConceptclass:Kanzi 3.7
Kanzi 3.8
TextBlockConcept::FontSizePropertyFontStyleConcept::SizePropertyTextBlockConcept::CharacterSpacingPropertyFontStyleConcept::CharacterSpacingPropertyTextBlockConcept::FixedCharacterWidthPropertyFontStyleConcept::FixedCharacterWidthPropertyTextBlockConcept::LineSpacingPropertyFontStyleConcept::LineSpacingPropertyMade these changes to the
FontManagerclass:Replaced
FontManager::createFontwith the functionality ofFontManager::getRuntimeFontintroduced in Kanzi 3.8.Removed
FontManager::getFontFamily. You can get the font family as a resource from theResourceManager.Removed
FontManager::createFontFamily. UseFontFamily::createinstead.
Moved these functions from
TextFormatandTextLayouterclasses to theFontStyleDefinitionclass:Kanzi 3.7
Kanzi 3.8
TextFormat::setLineSpacing,TextLayouter::setLineSpacingFontStyleDefinition::setLineSpacingTextFormat::getLineSpacing,TextLayouter::getLineSpacingFontStyleDefinition::getLineSpacingTextFormat::setCharacterSpacing,TextLayouter::setCharacterSpacingFontStyleDefinition::setCharacterSpacingTextFormat::getCharacterSpacing,TextLayouter::getCharacterSpacingFontStyleDefinition::getCharacterSpacingTextFormat::setFixedCharacterWidth,TextLayouter::setFixedCharacterWidthFontStyleDefinition::setFixedCharacterWidthTextFormat::getFixedCharacterWidth,TextLayouter::getFixedCharacterWidthFontStyleDefinition::getFixedCharacterWidthTextFormat::setShapingEnabled,TextLayouter::setShapingEnabledFontStyleDefinition::setShapingEnabled
Messages changes¶
Removed
kzuMessageType. UseAbstractMessageTypeDescriptorinstead.Removed the constructor of
MessageArgumentsthat takesAbstractMessageTypeas parameter. To dispatch messages usingAbstractMessageType, useNode::dispatchAbstractMessage().
Prefab View node changes¶
Prefab View nodes no longer recreate the node tree if the Prefab Template property (PrefabProperty) does not change. If your application relies on Kanzi to recreate the node tree on property write, such as with the On Attached trigger, you can force the recreation of the node tree by setting the Prefab Template first to an empty value.
Kanzi Engine plugin metadata changes¶
Changed the syntax of Kanzi Engine plugin metadata attribute SortingIndex to metadata.sortingIndex. See sortingIndex.
Other changes¶
Moved these headers to new locations:
Headers
Kanzi 3.8 location
Templates:
trigger_template.hpp
<KanziWorkspace>/Engine/include/kanzi/core.ui/templateTriggers:
message_trigger.hppon_attached_trigger.hppon_property_changed_trigger.hpptimer_trigger.hpp
<KanziWorkspace>/Engine/include/kanzi/ui/node_component/triggerActions:
dispatch_message_action.hppforwarding_action.hppplay_animation_action.hppset_property_action.hppwrite_log_action.hppset_focus_action.hppmove_focus_action.hpp
<KanziWorkspace>/Engine/include/kanzi/ui/actionAnimation node compoments:
animation_player.hppproperty_driven_animation_player.hppproperty_field_target_interpolation_timeline_playback.hppproperty_target_interpolation_timeline.hppproperty_target_interpolation_timeline_playback.hppproperty_target_interpolator.hpp
<KanziWorkspace>/Engine/include/kanzi/ui/node_component/animationFlipped the sign of the
PanManipulator::MovedMessagedelta.Calls in the
MeshandRendererclasses that handle changing either vertex or index data now take as bufferConstByteSpaninstead of the raw pointer and size.Moved kanzi/core/math/rational.hpp to kanzi/core/cpp/rational.hpp.
Removed
kzs_math. Usekanzi/core/cpp/limits.hpp,kanzi/core/cpp/math.hpp,kanzi/core/math/math_utils.hpp,kanzi/core/cpp/algorithm.hppinstead.Removed
kzsThread. Usestd::threadinstead.Removed
kzsThreadSleep. Usestd::this_thread::sleep_forinstead.Removed
kzsThreadLocalStorage. Usethread_localinstead.Removed
KzcFile,KzcOutputStream, andKzcInputStream. UseReadOnlyDiskFile,WriteOnlyDiskFile,ReadOnlyMemoryFile,MemoryParser,MemoryWriter, and file_util.hpp instead.