Announcement

Collapse
No announcement yet.

Override Blueprint Read Only Flag

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [FEATURE REQUEST] Override Blueprint Read Only Flag

    Hi,
    Some of variables that usually you want to edit are tagged with "blueprint read only"


    Probably due forgot to enable it edition at blueprint.
    Could please add some way to override that flag definition inside the blueprint?
    Thanks!
    Last edited by Krakhat; 12-06-2019, 04:17 PM.

    #2
    Having specifier like "read-only" that could be overridden would defy entire point of such specifier

    I'm afraid, you'd have to request changing this specifier for every single property you need.

    Comment


      #3
      Originally posted by Doctor Ergot View Post
      Having specifier like "read-only" that could be overridden would defy entire point of such specifier

      I'm afraid, you'd have to request changing this specifier for every single property you need.
      Since i can get the source code and build the engine overriding it in c++, theres no reason for it be blocked at blueprints
      Just make our life easier

      Comment


        #4
        It wouldn't make anybody's life easier. Changing flags such as "IsFocusable" in runtime could be not enough to change the actual state of the object.
        That's why you can edit many properties in the editor, but it's marked BlueprintReadOnly. If you want to change something in runtime, you do it by calling an appropriate function that updates logic of object after the property (i.e. "IsFocusable") changed.

        I don't know this specific code, it's just an example. It's possible that button needs to be registered to some "UI navigation data", so user can actually focus on it. And if the button isn't focusable, Slate optimizes it. Maybe it's not even possible to change the "focusable" state in runtime, so changing a variable wouldn't change anything for you.

        The programmer controls what the user can do with the system because he knows the system.
        We can't allow users to change what they want since they don't know what happens in code. Often they property would be changed, but this wouldn't magically trigger a change in the logic. And it would only mess up data.
        Afterward, we'd have to thousands of threads on forums like "I have overridden property specifier, but changing property changes nothing". And we would have to explain how the programming works

        Hopefully I managed to explain the issue
        Last edited by Doctor Ergot; 12-09-2019, 06:48 AM.

        Comment


          #5
          UPDATE #2: Doctor Ergot was faster, but I'm gonna leave this here anyways

          Originally posted by Krakhat View Post

          Since i can get the source code and build the engine overriding it in c++, theres no reason for it be blocked at blueprints
          Just make our life easier
          There's usually a reason why are they flagged like that: setting it wouldn't work, could lead to unexpected results / errors, there is a separate setter, etc. If you believe there are some exceptions, then open a PR with the suggested changes, engine developers also make mistakes - but the `ReadOnly` flag itself is certainly a necessity and there is a reason it exists, it would be nonsense to make the read-only flag removable from blueprints.

          For your specific case, not being able to set `IsFocusable` is actually uncomfortable - it'd need some code review if there is a reason why it's read-only, and if there is not, then make the change locally or open a PR

          UPDATE #1: I ran through the code of Button very fast and it'd probably need a setter, as it should also update the underlying SButton. So in this case ReadOnly seems legit and necessary.
          Last edited by KristofMorva; 12-09-2019, 05:52 AM.
          Kristóf Morva
          Game Programmer at Zen Studios and founder of Rapax Softworks
          LinkedIn, Engine Contributions, Marketplace
          Polars (WIP), Game Jam Projects

          Comment


            #6
            I understand that if the variable is just read with purpose for Default construction value, it state is useless to runtime.
            And that changing a variable if theres no update logic to read it, won't cause any change at runtime.

            In the case of the "IsFocusable", at class "UserWidget" and any children, set "IsFocusable" is avaliable directly.
            In case of the class "ContentWidget" and children it's lacking method to set the "IsFocusable" at blueprint, though you still can set it default value at details pannel.

            About the other example i gave, is the new added feature at 4.23 to height fog: "SecondFogData".
            It's certainly is a mistake because the structure of that parameter read by material every frame is flagged with "BlueprintReadOnly", while all the other fog parameters can be changed at blueprint.

            So if blueprint had the possiblity of bruteforce override that flags would be useful for solve such type of mistakes easily without me having to open PR or do myself at engine source code, even if in some cases results in no effect or logic problems. If you override the flags it's your responsability know what you're doing.
            Last edited by Krakhat; 12-09-2019, 12:26 PM.

            Comment


              #7
              It's great to see this way, but this still doesn't change the fact that the user shouldn't be able to change the intention of the system's author. And they would break a lot, complaining for anybody but not them
              Also impossible in UE4, property specifiers can be defined once. Can't be re-defined in C++ child classes, since it would allow even programmers to make a mess.

              Sorry, you have 2 separate issues to report
              Issues that should be considered by appropriate engineers without breaking the fundament programming concept that no one would accept anyway


              Originally posted by Krakhat View Post
              In the case of the "IsFocusable", at class "UserWidget" and any children, set "IsFocusable" is avaliable directly.
              In case of the class "ContentWidget" and children it's lacking method to set the "IsFocusable" at blueprint, though you still can set it default value at details pannel.
              If properties are available only in Details panel, it doesn't mean that it could be changed at runtime. Details panel allows to set default values of given class.
              Changing value itself could have no effect on object's behavior.
              Last edited by Doctor Ergot; 12-09-2019, 01:20 PM.

              Comment

              Working...
              X