UE5.2: PCG - Static Mesh as a Variable

Поділитися
Вставка
  • Опубліковано 9 вер 2024

КОМЕНТАРІ • 35

  • @unrealitybites763
    @unrealitybites763  Рік тому +3

    Here is an even simpler solution to setting up Static Mesh Variables that doesn't involve setting up a new BP node
    ua-cam.com/video/T4HvhuQfTo8/v-deo.html

    • @graemepalmer2306
      @graemepalmer2306 Рік тому

      Thanks for sharing both of these methods, and all the other awesome tutorial content! - I was wondering if you would mind pointing me in the right direction with something please.
      What I would like to do is directly filter/select points in PCG via their index number, but it seems there is no functionallity for this?
      What I have been trying to do is to take the method you have shown here to save the current index number as a new attribute to be able to access key points (start and end of spline for example)
      But Im getting confused as to the execute function loop vs the point loop, and cant seem to work out how I could store the current indexs?
      Any advice you have would be greatly appreciated!
      Cheers!

    • @unrealitybites763
      @unrealitybites763  Рік тому +1

      Firstly, to clear up your confusion, in the PCG Blueprint Element node, the following events happen:
      - the Execute function is called, typically this will happen once for the whole data set passed in.
      - the Point Loop will execute for every point you passed in.
      In the point loop, you can get access to the Index, from the "In Point" pin, do a "Break PCG Point". For some reason, instead of calling it Index, is is called "Metadata Entry".
      Now you can process the point based on the index value.

    • @graemepalmer2306
      @graemepalmer2306 Рік тому

      @@unrealitybites763 Amazing, thank you so much for your help!

    • @graemepalmer2306
      @graemepalmer2306 Рік тому +1

      @@unrealitybites763 I just gave this a go, but unfortunatly I seem to only get a value of "-1" on each point (I tested by printing to log and saving as density) if I take the data from the transform etc I can also confirm that I am pulling data from the points correctly.

    • @unrealitybites763
      @unrealitybites763  Рік тому

      Well, I just tried it again, and I definitely get a sequential set of integers from the "Metadata Entry" in my Point Loop Body. However, I don't know why it's called Metadata Entry and I can't seem to find a simple Get Point Index function.

  • @MichaelRoyalty
    @MichaelRoyalty Рік тому +2

    You're a certifiable genius! Thanks for figuring this out and making a tutorial on it!

    • @MichaelRoyalty
      @MichaelRoyalty Рік тому

      I updated it to take a struct array and added a "weight" variable -- now it simulates the Static Mesh node where you make an array of weighted static meshes, but I can build it in the blueprint instead of inside the PCG graph, and still set up unique static mesh spawns for each blueprint instance!

    • @unrealitybites763
      @unrealitybites763  Рік тому

      That sounds great! How did you pass the array into the PCG Graph?

    • @MichaelRoyalty
      @MichaelRoyalty Рік тому

      @@unrealitybites763 Since PCG graph doesn't handle arrays, I use a "Get All Actors With Tag" node inside the PCG Blueprint. To keep everything in one place I have the struct array living in the Spline blueprint, which is tagged. The PCG blueprint basically finds its owner and pulls in the array.
      I can't pass the array outside of the PCG blueprint, so I handle all the random mesh selection in the blueprint itself based on $Density, which I've set with a Density Noise node.

  • @satyakimandal6572
    @satyakimandal6572 Рік тому

    Finally someone came up with a solution! Thank you so much!

    • @unrealitybites763
      @unrealitybites763  Рік тому

      Yes... and there's an even simpler solution which I will publish later today

    • @satyakimandal6572
      @satyakimandal6572 Рік тому

      @@unrealitybites763 Thanks in advance!

  • @arturrosa3166
    @arturrosa3166 Рік тому

    Your tutorials are amazing. Thank you!

  • @Project_Erasmus
    @Project_Erasmus Рік тому

    Absolutely marvelous! Thank you very much.

  • @chrisbauer6162
    @chrisbauer6162 10 місяців тому

    Great video! Thanks for the help!

  • @TRanslationStudio
    @TRanslationStudio Рік тому

    Thank you very much for the tutorial (Also all the other ones in the channel) all of them are great tutorials.
    I have noticed something strange with the way how nodes work in the PCG. You need to use a density filter or density noise node before Assign Mesh to Points, otherwise nodes like Difference does not allow for Mesh input to show up in the Assign Mesh to Points.
    Just wanted to mention for further discussion or if someone else is having a problem with the node not working properly.

    • @unrealitybites763
      @unrealitybites763  Рік тому

      Yes, I've noticed this behaviour. This is because nodes like the projection node output general data, whereas the nodes you mention output concrete data (with point data). I always put a Transform Points node between projection and other nodes for that reason, even if I'm not changing anything.
      I'm guessing this issue will go away in the future as PCG loses its experimental status.

  • @mae2309
    @mae2309 Рік тому

    SO cool!! amazing!

  • @gsingh22ify
    @gsingh22ify Рік тому

    love you mate

  • @NahorCA
    @NahorCA 11 місяців тому

    @unrealitybites, at 20:15, by executing "return node" within the loop, you're only processing the first iteration of said loop. So if your node has multiple inputs going into the same pin (e.g. because you sample splines as well as surfaces), only the first input will be processed. Instead, you should add the PCGTaggedData to local array, and once the loop is complete, create the PCGDataCollection from that array and return.

    • @unrealitybites763
      @unrealitybites763  11 місяців тому

      Thanks for the info, Nahor. I'm going to have to redo these PCG videos for 5.3 at some point anyway, as so much has changed.

  • @Cpt.Tripps
    @Cpt.Tripps Рік тому

    Quality content!

  • @AlexiosLair
    @AlexiosLair 9 місяців тому +1

    Really hoping there will be a tutorial for 5.3 on this!

  • @Moonskimmin
    @Moonskimmin 8 місяців тому +2

    Hi, love your work. I'm getting an error at the end of the process where it says the MeshFilePath which is what I named it is on the actor but not visible. I don't know what that means or how to go about fixing it. Anybody had this problem?

  • @user-fx8wp1jt6z
    @user-fx8wp1jt6z 8 місяців тому

    Rhanks for the tutorial, i followed everything correctly, the mesh changes from blueprint but the pcg doesnt update the mesh unless i move the BP slightly.

  • @satyakimandal6572
    @satyakimandal6572 Рік тому +1

    My static mesh spawner shows "Mesh" Attribute not found even after attaching the "Assign Mesh To Points" to the graph. I have set the graph following the same. What can I do to fix it? Also, the "Get Actor Property" does not register the Mesh File Path too. Am I missing something? Please help!!

    • @unrealitybites763
      @unrealitybites763  Рік тому

      Use the inspector on the "Assign Mesh to Points" node to check if your new mesh attribute is there. If not, check through your code to make sure you have not mis-spelled anything or connected anything incorrectly.
      If all else fails, I've published an even simpler way to do this at ua-cam.com/video/T4HvhuQfTo8/v-deo.html

  • @parchk-xx9lj
    @parchk-xx9lj 8 місяців тому

    Hi, this is a great tutorial, but I have a question why not use soft object path as the type of the parameter? Is there any disadvantage?

  • @peterzhang8052
    @peterzhang8052 Рік тому

    The type of output is normally points with attributes, I wonder is there a way that can output static mesh, or any other way, like cache type? So that I can take that generated result as 'landscape' of a new PCG, I tried for subgraph, however still couldn't figure that out.

  • @TheMadKid91
    @TheMadKid91 Рік тому

    how to make that custom pcg node to be like pcg static mesh spawner ?

  • @michaelpiper8198
    @michaelpiper8198 Рік тому

    I'm still getting the same error as other comments have been and I have gone over the system repeatedly to make sure it is definitely spelled correctly and for sure connected correctly.. could you redo this video now that Updates have been made since maybe that is why even your other "simpler" video didn't work correctly and doesn't help that you mention in the setup video I actually want to do tells me I MUST do this one.
    For clarity the error I will either receive is "downgraded to order consistent at node:(random node that at times are not even present in graph)"
    at times that I have resolved sometimes by messing with nodes but I will 100% always receive on both mesh scale and mesh file path an error that says "error: Property MeshFilePath does not exist in found actor" or "error: not matching actor was found"
    neither make sense to me as I have even gone as far as putting the property in other actors that it might be pointing to but still get told the property/actor can't be found.

  • @placebo_yue
    @placebo_yue 4 місяці тому

    for christssake it shouldn't be that hard