MOC3DImporter
Part of the Minds of Chimera Project (dev)
CodeBlocks | MOCPlaytimeTracker | MOCDBLib | RegenBlock | MOCGoodEats | MOC3DImporter | ImageImport | MOCKiosk | MOCRater | MOCFizziks | GravitySheep | MOCChemistry | MOCRegistry
MOC3DImporter allows for users to easily import .obj files containing 3D models into the Minecraft world. Uses WorldEdit
.obj parsing is done using http://www.pixelnerve.com/processing/libraries/objimport/. Actual conversion of vertices to blocks is done by me.
Video
Permissions
MOC3DImporter.use - allows for ful use of the plugin. Default - op.
Use
/3di filename.obj [-t] [height] - Opens the selected obj file and builds it based on player's location. -t will attempt to use texture info (limited to broken :) Optional height will scale the model to be that high, still starting based on player's location. Bottom of the object will always be at the player's location unless it is under/over the world, then the bottom will be set to 0. Model itself will be centered on the player.
Config.yml
BlocksPerQueue: 10000 - How many blocks will be built each queue call. Lowering this may help with lag, setting too high can possibly lock the server. Play around see what works best. QueueDelay: 5000 - Time in between each queue call in milliseconds. StepDONTCHANGE: 0.2 - Part of algorithm. Value needs to somehow add up to 1 steps, 0.2, 0.1, 0.5, 1 would be good values. Higher values will speed up matrix generation, but will likely cause models to have holes in them. If matrix generation is slow, I would only suggest changing this to 0.5.
OBJ File location
/plugins/MOC3DImporter/data/ Make sure to remove any MTL references from the OBJ file if .mtl file is not present or if you are getting errors even with .mtl available
Notes
Model will be hallow inside and if it does intersect with something in the world, area will not be cleared first. So while all blocks of the model will be set to well right now bed rock they may be under ground etc. Be careful where you do this, as there is no undo atm :)
Final note
While the conversion to voxels is done in a separate thread and is fairly quick, the building phase will likely lag the server to the point of kicking the players offline. You can try adjusting some of the settings in config.yml, but in most cases just use default and just give the server few minutes to recover.
do you still alive ;-; ?
Here are some tips to help folks along
Problem: Help! The model I picked renders with lots of holes!
Solution: You need more vertices! Let's add some with blender (download and install from blender.org). Open blender, remove the default cube (right click on list on right and select delete) in blender so you have a clean workspace, import the model you are working with (file --> import), on the right drill into the vertices for your newly imported object and select with your mouse (the newly imported model will change color if you did it right), then on the left click the subdivide button to subdivide the model and increase the number of vertices. Final step is to export to a new .obj file (file--> Export) and try it in minecraft!
Problem: The model I picked didn't do anything!
Solution: Open it in blender and see if there is extra junk in the model that you were expecting. Delete it. You might also rotate the model around if needed. I also scale the model down if it is too big, that seems to help. One final thing to check is to download notepad++ and open the .obj file for your model, remove the line that refers to mtl (it is usually in the first 10 lines of the file.
Ah! I had just started to build a similar mod, but it was using schematic files. I was hitting memory limits when trying to import large .schematic files.
I am glad to have found this. How far done is the texture colour -> block type mapping? I want to see colourful models :) I would be happy to help out on this. Is the project on github?
@BBFChaser
I'm sure there are some places online to find 3d models, or you can make them yourself in things like Blender, AutoCAD, Maya etc.
http://www.turbosquid.com/Search/3D-Models/free/obj
Lag wise it all depends on the size you want the model to be, the more blocks that have to be changed on the server the more it will lag it while it's being built.
This is pretty interesting is there a database for .obj files and how bad does it lag things when adding?
Version 1.2 uploaded.