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"

Critical issue with StaticMesh class [4.8P3+]

There is a critical issue with current 4.8 Preview 3+ when trying to create class based on StaticMesh. Steps to reproduce:

  1. Download actual 4.8 sources from github. Compile it (VS2013, dev. editor, Win64, all by default)

  2. Run editor. Create C++ project->Basic code (template doesn't matter, I suppose).

  3. Restart editor, compile UE4Editor-TestProject if message box appears.

  4. File->New C++ class, check "Show all classes" and select StaticMesh. Next. Name it, lets say, SMTeleport, Create Class. Editor will try to compile it. It will fail. Now switch to opened Visual Studio and try to compile it by youself. And you will get:

Error 4 error C4150: deletion of pointer to incomplete type 'FStaticMeshRenderData'; no destructor called C:\DevProjects-Games\UE4_v48\Engine\Source\Runtime\Core\Public\Templates\ScopedPointer.h 40 1 TestProject

Error 5 error C4150: deletion of pointer to incomplete type 'FStaticMeshRenderData'; no destructor called C:\DevProjects-Games\UE4_v48\Engine\Source\Runtime\Core\Public\Templates\ScopedPointer.h 40 1 TestProject

Visual Studio points me here:

 /** Destructor. */
 ~TScopedPointer()
 {
     delete Reference; <--- here.
     Reference = nullptr;
 }

Please, fix it as soon as possible.

Product Version: UE 4.8 Preview
Tags:
more ▼

asked May 25 '15 at 07:29 PM in Bug Reports

avatar image

Krakean
16 2 8 13

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

2 answers: sort voted first

Hey Krakean-

What are you trying to use the Static Mesh subclass for? If you're trying to add functionality for a teleporter you've created it may be better to use an actor or a static mesh component that can be added to an actor blueprint instead. Subclassing the Static Mesh would mean that you're trying to add code directly to the mesh rather than using the mesh to represent something else that uses the code. Let me know if that helps at all.

Cheers

Doug Wilson

more ▼

answered May 26 '15 at 03:49 PM

avatar image Krakean May 26 '15 at 04:01 PM

Hi, Doug. Well, I trying to create a simple Teleport object, which can be placed in editor by level designer and where this level designer can specify, in Teleport's details window, to which another teleport object a player should be teleported when player enters this, uhm, teleport.

I didn't found in C++ documentation anything what can help me to solve this issue, at least in terms of what class my object should sub-class in such case (pawn? actor? actor component? scene component? staticmesh?).

Plus, I'm not much interested in blueprints, I prefer to create as much as possible via C++. At least my project is multiplayer-only and will contain several maps, so I want to all common things to be done in C++, and only those which are unique for some levels - in blueprints.

avatar image Doug E ♦♦ STAFF May 26 '15 at 04:11 PM

Your best bet would be to create an Actor subclass with the functionality of the teleporter you want. Exposing a pointer of the teleporter class in code will allow the designer to pick other teleporters placed in the editor as the return point. Using a StaticMeshComponent pointer in code will allow you to set what mesh you'd like to use to represent the teleporter while the functionality remains on the actor.

avatar image Krakean May 26 '15 at 04:33 PM

Thanks, Doug. I will try it. But still, may be then "StaticMesh" should be removed from "Show All Classes" list, if it cannot be used since even simple sub-classing from it produces inability to compile?

avatar image Nick Darnell ♦♦ STAFF May 26 '15 at 06:18 PM

No - it's possible to subclass it, but the logic for generating the sub-classed file can't deal with all the constraints of C++, it just makes a best guess. There are sometimes files you need to manually include at the top of your files/PCH in order to compile that it can't automatically figure out right now. In this case you're likely missing StaticMeshResources.h which is where FStaticMeshRenderData is defined.

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

Why are you sub-classing UStaticMesh?

more ▼

answered May 26 '15 at 03:14 PM

avatar image

Nick Darnell ♦♦ STAFF
6k 77 37 151

avatar image Krakean May 26 '15 at 03:48 PM

Well, why not? :)

I just create C++ class via Editor, and it offer me (after I check "Show All Classes") to sub-class StaticMesh. As a result in Visual Studio I have my newly created class which is sub-classing UStaticMesh.

If UStaticMesh shouldn't be sub-classed, then why it listed in "Show All Classes"?

Anyway, there is not much to sub-class - since you even cannot compile it just after you created class from StaticMesh via editor. Or may be there is should be something additionally added to generated cpp/h files so it can at least compile?

(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