Skip to content
Snippets Groups Projects
Commit e440deb9 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

- Added a quick hack to prevent the component from moving. Moving...

- Added a quick hack to prevent the component from moving. Moving theoretically doesn't affect rendering etc, but it does offset the individual point property gizmos for editor lines. That's incredibly annoying.
parent 39f01207
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,9 @@
UGPUInstancedLineComponent::UGPUInstancedLineComponent(const FObjectInitializer& ObjectInitializer)
{
SetWorldTransform(FTransform::Identity);
SetUsingAbsoluteLocation(true);
SetCastShadow(false);
SetCollisionEnabled(ECollisionEnabled::NoCollision);
SetGenerateOverlapEvents(false);
......@@ -32,6 +35,9 @@ UGPUInstancedLineComponent::UGPUInstancedLineComponent(const FObjectInitializer&
TextureWidth = 2048;
TextureHeight = 2048;
SetMobility(EComponentMobility::Static);
//DynamicLineMaterial = nullptr;
//PositionTexture = nullptr;
}
......@@ -419,6 +425,12 @@ void UGPUInstancedLineComponent::PostEditChangeProperty(FPropertyChangedEvent& P
Super::PostEditChangeProperty(PropertyChangedEvent);
}
// This is hacky - reset the transform to 0,0,0 every time the component is moved to not mess up the editor gizmos
void UGPUInstancedLineComponent::OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport)
{
SetWorldTransform(FTransform::Identity);
}
#endif
// Doesn't do anything yet, just as a testing function to see execution order on Unreal startup.
......
......@@ -75,7 +75,7 @@ struct FEditorLineData
};
UCLASS(Blueprintable, BlueprintType, meta = (BlueprintSpawnableComponent), HideCategories=("Instances"))
UCLASS(Blueprintable, BlueprintType, meta = (BlueprintSpawnableComponent), HideCategories=("Instances", "Object", "LOD", "Physics", "Activation", "Materials", "Cooking", "Sockets", "Collision", "Mobile", "HLOD"))
class INSTANCEDMESHLINERENDERING_API UGPUInstancedLineComponent : public UInstancedStaticMeshComponent
{
GENERATED_BODY()
......@@ -125,6 +125,9 @@ protected:
#if WITH_EDITOR
virtual void PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) override;
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; // need this for the widget as for some godforsaken reason the Chain event doesn't fire...
// This is ABSURDLY hacky
virtual void OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport = ETeleportType::None) override;
#endif
virtual void PostLoad() override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment