Does anyone know how to make a Blender model an actor?

Tutorials and discussions about Mapping - Introduce your own ones!
Skerion
Average
Posts: 70
Joined: Fri May 09, 2014 12:04 am

Does anyone know how to make a Blender model an actor?

Post by Skerion »

I'm trying to convert a tree model I made in blender into a decoration entity that I can use in Blender. I was trying to use 3ds2unr to get started on that, but whenever I dragged the 3ds file onto the exe, it said that an out of sequence object (the tree model itself in this case) was skipped. I tried giving the 3ds file a sequence number at the end of the filename, but that didn't seem to help.

Also, would anyone know how a regular Blender grid would compare to 3DsMax's grid? I feel like that might be helpful to know.
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Does anyone know how to make a Blender model an actor?

Post by Spectra »

You can export the model from blender as .obj and import the obj into milkshape 3d. Then export the model as LODMesh or SkeletalMesh.
For SkeletalMesh you will have to export it twice. One for .psk - actual mesh and other for .psa - animations. If your model is not animated, then .psk file itself is fine.
User avatar
SteadZ
Average
Posts: 67
Joined: Mon Mar 10, 2014 11:19 pm
Personal rank: 1337
Location: Scotland
Contact:

Re: Does anyone know how to make a Blender model an actor?

Post by SteadZ »

The out of sequence object means that your actual model object name (Cube3 for example) in blender is skipping numbers. Make sure that your object name has a "1" at the end and you'll be ready to go! :)

However there are a couple of other options.
Skywolf has recently made a plugin for Blender which will export directly to .3d format, bypassing the need for 3ds2unr altogether, and
if you want to make skeletal meshes as Spectra is suggesting, that is possible through Blender directly too.

Happy Modelling! :D

.......
SZ
.......
"The problem with dreams is... you never know when you're gonna wake up"

Image
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Does anyone know how to make a Blender model an actor?

Post by nogardilaref »

Does that skeletal mesh export work on the latest version of Blender though?
I remember seeing one around ages ago, but it was for 2.6, and once I tried it on 2.7 at the time, it didn't work at all (probably a different python API with 2.7), although I heard stories that someone else was updating it elsewhere.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Does anyone know how to make a Blender model an actor?

Post by JackGriffin »

If you are making a simple decoration without anims then there's another much simpler method that I use all the time. Smirf built in support for .obj import into the editor in 227 Unreal. I follow this workflow:
-Import obj directly into the 227 editor
-place instance of the imported object into a test level
-right click on object/convert> to brush
-Place a second instance and delete the first one/rebuild all

Now you have a copy of the model that is built using bsp additive brush and you can easily use meshmaker to make your mesh. One caveat: meshmaker *will* fail if you try to use it on a brush generated by 227. You need to move the exported brush over to UT's editor if you want to process the model using meshmaker.

Meshmaker is not nearly as powerful as even the most basic model program but the upside is in 10 minutes I can have anyone fully able to make custom decorations out of the millions of free obj files all over the web.
So long, and thanks for all the fish
Skerion
Average
Posts: 70
Joined: Fri May 09, 2014 12:04 am

Re: Does anyone know how to make a Blender model an actor?

Post by Skerion »

SteadZ wrote:However there are a couple of other options.
Skywolf has recently made a plugin for Blender which will export directly to .3d format, bypassing the need for 3ds2unr altogether
This looks pretty useful, though the website made me register an account just so I could view the thread.

Also, I got this error after trying to export the model:

Image

The name of the materials are 000_CL, 001_CL, and 002_NM.
Spectra wrote:You can export the model from blender as .obj and import the obj into milkshape 3d. Then export the model as LODMesh or SkeletalMesh.
For SkeletalMesh you will have to export it twice. One for .psk - actual mesh and other for .psa - animations. If your model is not animated, then .psk file itself is fine.
Should I worry about the fact that the free version of Milkshape is apparently a 30-day trial? The website says that "all saving functions will be disabled", but it didn't specify whether that included the export options. I'm not as concerned about the ability to save as I am about the ability to export.
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Does anyone know how to make a Blender model an actor?

Post by nogardilaref »

^ That's exactly why I asked this above:
nogardilaref wrote:Does that skeletal mesh export work on the latest version of Blender though?
I remember seeing one around ages ago, but it was for 2.6, and once I tried it on 2.7 at the time, it didn't work at all (probably a different python API with 2.7), although I heard stories that someone else was updating it elsewhere.
Last edited by nogardilaref on Tue Sep 05, 2017 7:31 pm, edited 1 time in total.
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Does anyone know how to make a Blender model an actor?

Post by Spectra »

Skerion wrote:Should I worry about the fact that the free version of Milkshape is apparently a 30-day trial? The website says that "all saving functions will be disabled", but it didn't specify whether that included the export options. I'm not as concerned about the ability to save as I am about the ability to export.
Yes, export options will be disabled too!
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Does anyone know how to make a Blender model an actor?

Post by nogardilaref »

As for this:
Skerion wrote: Should I worry about the fact that the free version of Milkshape is apparently a 30-day trial? The website says that "all saving functions will be disabled", but it didn't specify whether that included the export options. I'm not as concerned about the ability to save as I am about the ability to export.
I am not the one to advocate for piracy at all, but in this case, considering that even the site itself is not updated since 2011 (6 years), and things like PayPal deprecated and removed APIs and stuff a few times already since that time, and that payments are final without refund, and the software is 35$ (and it isn't worth that much) I wouldn't risk trying to get it the "normal" way anymore only to loose that money and never hear anything from the author anymore.

Unless someone is willing to be the guinea pig and try to pay it to check if it still works (not gonna be me).
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Does anyone know how to make a Blender model an actor?

Post by sektor2111 »

Cough (drunk) shall we debate purpose first ? I think we might have simple solutions and getting over blender. Or not ?
Skerion
Average
Posts: 70
Joined: Fri May 09, 2014 12:04 am

Re: Does anyone know how to make a Blender model an actor?

Post by Skerion »

Well, I kinda got the model working.

Image
Image

The problem is that the leaves textures were opaque by default, and I'm not entirely sure how to set up parameters in the .uc file where the leaves would be masked. I just went into the properties of the tree actors that were placed on that level and changed their rendering style to Masked, which made the trunks invisible.
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Does anyone know how to make a Blender model an actor?

Post by nogardilaref »

The directive flags value for masked textures is FLAGS=2 during the import, iirc.
However, it actually doesn't work very well. The texture gets somewhat marked as being masked, but is never rendered as such. This is actually something that the v451 patch fixes, and what some renderers try to fix in their own if set to do so I believe.
Skerion
Average
Posts: 70
Joined: Fri May 09, 2014 12:04 am

Re: Does anyone know how to make a Blender model an actor?

Post by Skerion »

nogardilaref wrote:The directive flags value for masked textures is FLAGS=2 during the import, iirc.
However, it actually doesn't work very well. The texture gets somewhat marked as being masked, but is never rendered as such. This is actually something that the v451 patch fixes, and what some renderers try to fix in their own if set to do so I believe.
Thanks, I'll look into that fix later.

Well, I might have figured out to successfully export models from Blender. It turned out that the material names needed to be named like 0, 1 and 2; not 000, 001 and 002. The screenshots above were done with Milkshape, and I'm very much hoping that I won't have to rely on that.

However, I get this error when I run it through UMake:

Code: Select all

----- Core
----- Engine
----- Editor
----- UWindow
----- Fire
----- IpDrv
----- UWeb
----- UBrowser
----- UnrealShare
----- UnrealI
----- UMenu
----- IpServer
----- Botpack
----- UTServerAdmin
----- UTMenu
----- UTBrowser
----- tree
Analyzing...
Parsing samtree
Mesh LOD processing: samtree
General protection fault!



History: UEditorEngine::meshLODProcess <- UEditorEngine::meshImport <- UEditorEngine::SafeExec <- (MESH IMPORT MESH=samtree ANIVFILE=Models\samtree_a.3d DATAFILE=Models\samtree_d.3d X=0 Y=0 Z=0 LODSTYLE=10 LODFRAME=0) <- FScriptCompiler::ProcessCompilerDirective <- Directive <- FScriptCompiler::CompileDeclaration <- FScriptCompiler::CompileStatement <- FirstPass <- TryCompile <- FScriptCompiler::CompileScript <- (Class Tree.samtree, Pass 0, Line 3) <- MakeScript <- MakeScript <- MakeScript <- DoScripts <- UEditorEngine::MakeScripts <- UMakeCommandlet::Main

Exiting due to error
This is what the .uc file that was used looks like:

Code: Select all

class samtree expands actor;

#exec MESH IMPORT MESH=samtree ANIVFILE=Models\samtree_a.3d DATAFILE=Models\samtree_d.3d X=0 Y=0 Z=0 LODSTYLE=10 LODFRAME=0 
#exec MESH ORIGIN MESH=samtree X=0 Y=0 Z=0 YAW=-64 PITCH=0 ROLL=0

#exec MESH SEQUENCE MESH=samtree SEQ=ALL    STARTFRAME=0 NUMFRAMES=0 RATE=24
#exec MESH SEQUENCE MESH=samtree SEQ=Still    STARTFRAME=0 NUMFRAMES=1 RATE=24

#exec MESHMAP NEW MESHMAP=samtree MESH=samtree
#exec MESHMAP SCALE MESHMAP=samtree X=0.1 Y=0.1 Z=0.2

#exec TEXTURE IMPORT NAME=outerleaves FILE=Textures\outerleaves.PCX GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=samtree NUM=0 TEXTURE=outerleaves.PCX

#exec TEXTURE IMPORT NAME=innerleaves FILE=Textures\innerleaves.PCX GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=samtree NUM=1 TEXTURE=innerleaves.PCX

#exec TEXTURE IMPORT NAME=treetrunk FILE=Textures\treetrunk.PCX GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=samtree NUM=2 TEXTURE=treetrunk.PCX

defaultproperties
{
    DrawType=DT_Mesh
    Mesh=samtree
}
I tried using the .3d files that were generated from the Milkshape exporter, and that sorta fixed the problem (There was another error that seemed unrelated to the previous one, something about missing textures), but I don't want to rely on Milkshape. I get the feeling that something went wrong when I used the Blender exporter, but i'm not sure.
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Does anyone know how to make a Blender model an actor?

Post by nogardilaref »

It's likely that Blender is not exporting the mesh correctly at all. :\
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Does anyone know how to make a Blender model an actor?

Post by sektor2111 »

Compiler directive do seems wrong.
Post Reply