The "Active Element" node would return early if the mode was not `OB_MODE_EDIT`. For Grease Pencil, we want to be able to query the active layer index from any mode. This changes the logic to only return early for the `Point`, `Edge`, and `Face` element if the mode is not edit mode. Pull Request: https://projects.blender.org/blender/blender/pulls/138491