Cannot modify component properties in child blueprints

Components added to parent blueprints cannot be edited in the child blueprint component tab. For instance, create a blueprint based on Actor called MyParent. Add a staticmesh component to it. Create another blueprint based on MyParent and call it MyChild. Notice you cannot modify any properties of the staticmesh component within MyChild. The properties can be modified through code, but that essentially duplicates the work of the components tab.

This makes supporting code reuse much more difficult than it needs to be. This was a handy feature in UE3. You could define a class like Weapon and define a subobject for the staticmesh. Weapon could then work with the staticmesh component and not really worry about what exact staticmesh asset was set in the component. Then you could create child classes of Weapon and just modify the properties and not have to add any additional code.

What is odd is components defined in C++ could have some of their properties edited in child blueprints. Perhaps its the CPF_Edit property? But this isn’t a solution either, because you cannot change the relative location of the component or the heirarchy in child blueprints. This makes the ability to set other properties, like the staticmesh asset relatively useless, since you can’t position things correctly.

Another item missing from blueprints defined components is the ability to edit the properties on instances. Being able to do that would allow stamping out several of the same type and just modifying some properties. Instead, you must create a blueprint per asset. Or create additional properties in the blueprint and copy the properties to the components. This can be cumbersome to do and forces you to chose which properties are worth exposing.

I’m hoping to get some suggestions on how to get around these restrictions, or better yet if Epic could look into removing the restrictions.

Hi!

Inheritance in the UE4 working with no problem. I think you do something wrong. If you add static mesh in Base BP in Components section, this mesh will be inherited in Child BP. You need add Static Mesh component to Base BP and set it like external variable. After create Child BP from Base BP, you can add different Static Meshes.

Thanks for the info. Let me clarify, inheritance is working, I was just hoping for more robust support for inheritance than currently exists. I’m familiar with the construction script approach as you outline. This is the approach I meant was less that ideal when I said:

Or create additional properties in the blueprint and copy the properties to the components. This can be cumbersome to do and forces you to chose which properties are worth exposing.

In terms of full featured support, I would want the ability in the components and defaults tab to be able to manipulate the properties of the components defined by parent blueprints. This is possible with C++ parents that define components. For instance, create a child Blueprint of the C++ class StaticMeshActor. Notice you can access all the properties of the “StaticMeshComponent” in this child.

This appears to be possible because StaticMeshActor’s StaticMeshComponent has the properties of “CPF_ExportObject | CPF_EditConst | CPF_InstanceReference | CPF_SubobjectReference”. These properties are missing from Blueprint defined components.

These properties in C++ components also allow the component to be edited per instance in a level. Again, all without having to make additional variables and construction script hookups.

My crazy idea would be to add these properties to Blueprint defined components. I don’t know if there was a specific reason they are not currently added by the engine. I couldn’t find anything in the engine code that suggested anything would blow up. I haven’t fully finished my experiment, but if you think that’s a bad idea, please let me know.

As an experiment to see if I could improve things by adding some of the property flags to components added through blueprints, I put this bit of code in FKismetCompilerContext::CreateClassVariablesFromBlueprint on line 568, where it is handling simpleconstructionscripts, which components have:

 NewProperty->SetPropertyFlags( CPF_ExportObject | CPF_EditConst | CPF_InstancedReference | CPF_SubobjectReference | CPF_EditInline );

This did add the properties to the component variables, but unfortunately did not help the issue. I still cannot edit the properties in the properties panel of the component. I still cannot edit the properties on an instance of the blueprint in a level. I’m baffled what is suppressing it from showing up. I thought those property flags would do it. There’s something that is enabling it from C++ but disabling it from blueprints, which makes me sad.

If you think this idea could work and you have some thoughts on where the blockage is coming from that would be great.

Found this old post which says basically its something Epic wishes to support in the future. It’s basically saying we’re stuck with the construction script approach. Would it be possible to get an estimate or any tips on how to get this done ourselves?

Modifying components of parent blueprint