Like if I have a Mass Entity with a Static mesh (using CrowdVisualization), and inside a Processor I want to modify the specific Entity’s Material Instance (Like a basic float), is it possible to modify this instanced material? If yes, how?
Nevermind, I found out how to make it, so for anyone that wants to do it just copy and paste this Processor, and just change the “FISMCustomData” with your own fragment that ONLY has floats.
include “ISMCustomDataUpdaterProcessor.h” include <MassRepresentationFragments.h> include <MassRepresentationSubsystem.h> include “MassLODFragments.h”
At the end I couldn’t find a fix, so until than I’ll try to make my own Visualization, and see if that helps, because I’ve a feeling that my SetCustomDataValue is working, but because there is another ISMProcessor from CrowdVisualization, they are fighting and nothing is showing up.
I’ll update if I can find a way to work around this.
I think you’re close… Look at MassUpdateISMProcessor, the execute function. Notice the transform update batching (this is necessary, otherwise you’re creating the churn mass is designed to avoid). Then search for the AddBatchedCustomData… functions, do your processor’s execute in a similar way. Also, you need to make sure the ISM you’re using for your visualizer is set up with the correct number of Custom Data Channels (this happens on init of the ISM), otherwise the data has nowhere to go.
Great new, I was able to make it work without having to create my own visualization, I literally went on every Public Mass projects on Github and copied and pasted stuff until this one (from MassSample) finally worked.
I’ve tested it with only one float and it works (If anything else happens I’ll come back), so worst case scenario you just have to make like one processor for each CustomData, which sounds nasty (and it is), but whatever gets the jobs done.
Remember that this is done in 5.7, and remember to use CrowdMember +CrowdVisualization and to set the CustomDataFloast to at least 1 on the StaticMesh section.
Also remember to actually use PerInstanceCustomData on your material.
PS. Also remember to switch this fragments here “FISMCustomData” with whatever fragment you have, BUT it can only contain floats (especially if you give it directly to AddBatchedCustomData).