x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to get static mesh from static mesh components [BP]

Hi all,

Does anyone know whether it's possible to get the static mesh used by a static mesh component through blueprints? Casting doesn't work and I can't find "Get Static Mesh", only "Set Static Mesh".

Thanks in advance!

Product Version: UE 4.10
Tags:
more ▼

asked Dec 02 '15 at 08:51 PM in Blueprint Scripting

avatar image

jasperweyne
6 1 2 3

avatar image Pierdek Dec 02 '15 at 09:13 PM

WAT?

 UCLASS(ClassGroup=(Rendering, Common), hidecategories=(Object,Activation,"Components|Activation"), ShowCategories=(Mobility), editinlinenew, meta=(BlueprintSpawnableComponent))
 class ENGINE_API UStaticMeshComponent : public UMeshComponent
 
 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=StaticMesh, ReplicatedUsing=OnRep_StaticMesh)
     class UStaticMesh* StaticMesh;
 
 /** Change the StaticMesh used by this instance. */
     UFUNCTION(BlueprintCallable, Category="Components|StaticMesh")
     virtual bool SetStaticMesh(class UStaticMesh* NewMesh);

Static mesh is accessible from StaticMeshComponent.

Show us what are you casting and how.

avatar image jasperweyne Dec 02 '15 at 09:21 PM

I'm using blueprints ;)

avatar image Pierdek Dec 02 '15 at 09:22 PM

Static mesh is accessible from StaticMeshComponent from BP.

Show us what are you casting and how.

avatar image jasperweyne Dec 02 '15 at 09:25 PM

This is from my class that's a child of actor, Static Mesh Component is inherited alt text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Well, you can't cast StaticMeshComponent to StaticMesh, but you can get this static mesh from StaticMeshComponent:

Drag this blue dot from the StaticMeshComponent and type SetStaticMesh/GetStaticMesh in function finder.

more ▼

answered Dec 02 '15 at 09:28 PM

avatar image

Pierdek
2.6k 73 49 131

avatar image jasperweyne Dec 02 '15 at 09:30 PM

Well that was easy, I was just being stupid x)

avatar image Pierdek Dec 02 '15 at 09:32 PM

Shame on you, you should delete this question and re-read documentation.

avatar image jasperweyne Dec 02 '15 at 09:33 PM

"We're sorry, but this question already has some answers that you cannot delete." Will reread docs though!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question