FACS are now -10 /10 instead of -1/1

Issue #2202 resolved
bouich jules created an issue

Hi,

I am using my daily routine export to game engine ( in UE the maximum is -5/5 ) , however i noticed with last commit i am getting this error:

Because Facs are set to -10 / 10 , however i checked my global settings i dont have this modifiers, eveything is normal -1/1 and nothing changed since last time,

I believe it might be related to the last commit.

Thank you,

Comments (9)

  1. Alessandro Padovani

    The -10 10 range for shapekeys is the maximum allowed by blender. It is necessary for the way daz studio works, to simulate daz sliders when they drive each other. You can of course change the range in the shapekeys panel before exporting, but unfortunately it is to be done one by one, there’s no tool in blender to change the range for all the shapekeys.

    Then those are warnings, not errors, meaning it is possible that the unreal exporter just exports -5 5 instead of -10 10.

  2. bouich jules reporter

    I think this quick script fixed it. but before didnt had to do it. before it was in 0-1.

    import bpy
    
    def set_shapekey_range_for_mesh(obj):
        if obj.type != 'MESH' or obj.data.shape_keys is None:
            return
    
        for key_block in obj.data.shape_keys.key_blocks:
            if key_block != obj.data.shape_keys.reference_key:
                key_block.slider_min = -5.0
                key_block.slider_max = 5.0
                key_block.value = 0.0  # Reset the value to 0
    
        print(f"Shape key ranges set to -5/5 for {obj.name}")
    
    def set_shapekey_range_for_armature():
        selected_obj = bpy.context.active_object
    
        if selected_obj is None or selected_obj.type != 'ARMATURE':
            print("No armature selected. Please select an armature.")
            return
    
        for obj in bpy.data.objects:
            if obj.parent == selected_obj or obj.find_armature() == selected_obj:
                set_shapekey_range_for_mesh(obj)
    
        print("Finished processing all meshes connected to the armature.")
    
    # Run the function
    set_shapekey_range_for_armature()
    

    Please confirm if before was the same, if it’s same you can close this as invalid, thank you.

  3. Alessandro Padovani

    Yes the daz morphs have been improved, in previous versions there were limitations, see #2158 #2073. If unreal can’t handle some blender shapekeys this is a limitation in unreal not a bug in the importer. The script you listed should work you can run it before exporting if the warnings are blocking the process. Be sure to backup first or undo later.

    p.s. Thomas is doing some simplifications so until this is finished and stable you may want to stay with commit d9d40cf.

  4. Thomas Larsson repo owner

    The +- 10 limits are gone now. Unless you enable adjusters. The object properties don’t have limits at all, only soft limits, whereas the final armature properties have the same limits as in DS, typically between 0 and 1.

  5. Log in to comment