Announcement

Collapse
No announcement yet.

Creating text meshes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Creating text meshes

    Hello!

    I want to create in my project 3D texts like that:
    http://www.starscenesoftware.com/stu...yingText12.png

    As Unreal Engine doesn't support creating geometry from blueprints, I'll need some workaround to achieve this...

    First, I thought I could create my texts directly in Blender and import them in my game. > Bad idea, if I want to create a multi-lingual project, I'll need to recreate meshes everytime.

    Then I thought I could create every letters then import them and create blueprints to build them. > Once again, it's probably a bad idea. What if I want multiple fonts? Bold? Italic? It will be way too heavy to create all letters...

    So now I thought I could use materials...

    Basically I could use a masked material and draw letters on the surface, and add depth to that material... Which doesn't seam to be possible as material only affects surface.

    Do you have any other idea how could I create 3D Text meshes?

    Thanks!

    #2
    I've done this. I created a complete character set using the free softimage mod tool - I made a script that creates each character of a font in 3d, then labels that mesh by its ANSI number, then, using a blueprint,I can get the ANSI number of each character in a string then spawn a mesh based on that number, offset by the width of the previous character.

    Comment


      #3
      That's a good idea, thanks!

      I'll try to use Blender scripts for that

      Comment


        #4
        Hope it's going well. although this teqnique works for me, I'm storing the paths to each character in a csv data table - the problem with these is that when you restart the editor, the data table nodes all disconnect and break the blueprints. If you can find a better way to store the asset paths I'll be interested to hear about it.

        Comment


          #5
          So here's how I do it:

          I created a node "Load Static Mesh from Path", available here (by Rama): https://wiki.unrealengine.com/Dynamic_Load_Object

          And in the path I just specify this FName: "Static Mesh'/Game/Shapes/Letters/SM_Letter_XXX.SM_Letter_XXX'" (actually I tweaked the C++ function so I don't need to specify twice the name etc.) XXX is the ASCII number of the letter (Node Get Number From Character).

          Then I just add the static mesh and add a relative offset from the letter bounds. (Get Actor Bounds node). That's it!

          Regarding the meshes, I could make the Blender Python script working. Unfortunately the wireframes aren't that good, I could use Smart UV Project which auto creates a UV Unwrapping but some joints aren't really nice. Are UVs better with Softimage?

          Last edited by Shelby; 08-13-2014, 02:10 PM.

          Comment


            #6
            Good old Rama! That's great to know he's done that - you've actually saved my sanity with that (i'll try it later).

            Softimage has some pretty good extrusion/bevel effects which is what i'm after. I haven't been mapping my text though - i've been using a simple texture on them.

            Thanks for the info - i'll let you know how it goes.

            Dan.

            Comment


              #7
              OMG - i'm such a C++ newb.

              I'm fine with blueprints and I've already done the relative offsety stuff - i'm actuallty working on a multi-line version at the moment - but my method of using a CSV table to point to the static mesh path falls over whenever I restart the editor. I'm pretty lame at C++ - there are always code examples for things, but I can never work out if it's supposed to go into a .h file or a .cpp file or what.

              So, in this case, did you just put the dynamic load function and some sort of UFUNCTION into a .h file?

              I'd be really appreciative of any help you can offer here.

              Dan.

              Comment


                #8
                I'm pretty new to C++ too, but once you know how to create basic new nodes, it gets quite easy.

                First if you haven't created C++ files for your project, generate them by right clicking on the .uproject and click Generate VS files.
                On the Editor, click on File, add code to project, and use as parent class BlueprintFunctionLibrary (I named my file UtilityNode):


                Then I'll give you directly the content of my header and source files:

                Header file: (Where you define your functions):

                http://pastebin.com/gd56ufMm

                And the .cpp file:

                http://pastebin.com/quxXpwj9

                (Replace YOURPROJECTNAME by yours)


                You can have more informations about BP nodes here: https://wiki.unrealengine.com/Custom..._Node_Creation
                Last edited by Shelby; 08-15-2014, 06:33 AM.

                Comment


                  #9
                  Thanks so much Shelby - I can't tell you how chuffed I am with this. I was about to embark into the realm of C++ - and i'd have got it really wrong before I made progress. I still intend to learn it but thanks for the head start.

                  Dan.

                  Comment


                    #10
                    Originally posted by Shelby View Post
                    So here's how I do it:

                    I created a node "Load Static Mesh from Path", available here (by Rama): https://wiki.unrealengine.com/Dynamic_Load_Object

                    And in the path I just specify this FName: "Static Mesh'/Game/Shapes/Letters/SM_Letter_XXX.SM_Letter_XXX'" (actually I tweaked the C++ function so I don't need to specify twice the name etc.) XXX is the ASCII number of the letter (Node Get Number From Character).

                    Then I just add the static mesh and add a relative offset from the letter bounds. (Get Actor Bounds node). That's it!

                    Regarding the meshes, I could make the Blender Python script working. Unfortunately the wireframes aren't that good, I could use Smart UV Project which auto creates a UV Unwrapping but some joints aren't really nice. Are UVs better with Softimage?

                    Hey Shelby, and Dan!

                    Could you share the blueprint you're using to get the Unicode of each character? I seem to only be getting the code for the first character in the string.

                    Any other blueprints for this would be appreciated too.
                    Last edited by HaxO; 09-25-2014, 04:17 PM.

                    Comment


                      #11
                      Hi Haxo,

                      The function is Get Character By Number, which returns the ansi value of a character. You can loop through a string with a for next loop going from 0 with a string len function plugged in to the last index node - then loop through each character which you can put into an int array in order to build your string.

                      Dan.

                      Comment


                        #12
                        Thanks! I will try this out tomorrow!

                        Comment


                          #13
                          //Sorry, I am new to C++. What is the "Utility node" doing in relation to the "Load Dynamic Mesh from Path" node?

                          Alright, I got that figured out. Now storing all of the ANSI characters in an array.
                          Last edited by HaxO; 10-02-2014, 10:03 AM. Reason: Progress

                          Comment


                            #14
                            How did you attach the 'Load Static Mesh from Path' node to the 'Add StaticMeshComponent' node?

                            Comment


                              #15
                              Ok, so I couldn't get the load static mesh from path to add static mesh component working. So instead I used a switch and got the bounds of the model, added the kerning/spacing, and placed the next mesh based off of that.

                              Its a bit redundant but it gets the job done!

                              Last edited by HaxO; 10-03-2014, 11:01 PM.

                              Comment

                              Working...
                              X