20tab / UnrealEnginePython

Embed Python in Unreal Engine 4
MIT License
2.75k stars 746 forks source link

Matplot lib example - can't get StaticMeshComponent #744

Open dagillespie opened 5 years ago

dagillespie commented 5 years ago

Following your matplotlib example, after installing matplot lib to the embedded python in UE4.22, I can't get access to the static mesh component in the graph actor. Have followed as per the example but it's not working. Has the syntax changed on accessing the static mesh component from an actor? UnrealEnginePythonMatplotLib

Error in the console is:

unreal_engine.UObject' object has no attribute 'StaticMeshComponent ... self.uobject.get_owner().StaticMeshComponent.OverrideMaterials[0].set_material_texture_parameter('Graph', self.texture) AttributeError: 'unreal_engine.UObject' object has no attribute 'StaticMeshComponent'

dfb commented 5 years ago

In the example, the component was named 'StaticMeshComponent' but from the screenshot above it looks like you named it something else. This should be totally fine, you just need to change your code to use the same name.