Jump to content

Blender 3D Scripts


Jab

Recommended Posts

A picture is worth a thousand lines of code.

 

iulTk8IvS52P1.png

 

 

So I'm importing the animations into Blender's "Action" engine, where each object (In this case, our rig), has actions that store different animation types, and can be used in various ways in the Blender environment.

 

Animations are still loading flipped, so for now, bob is left-handed. I'll look into a decent way to fix that issue sometime before the script is done.

 

If you want to try it out for yourself, take a look at this temporary new python script I added to the GitHub repository here:

(WARNING: the script takes a minute or so to load the animations in, feel free to toggle Blender's console to see what's going on if you are into that kind of thing)

https://github.com/JabJabJab/BlenderZomboidIO/blob/master/ZomboidImportNew.py

 

Just hit that link and click on 'Raw' at the top of the page to get the raw Python script to paste into the Script Editor in Blender.

Link to comment
Share on other sites

  • 2 weeks later...
 

 

 

So, is this working for a mod? Or we have to modified the actual game?

I haven't been able to make it work as a mod yet.

>stuff<

Have you been able to make it work as a mod Fuji?

Yep, but only if you replace the original file. I've been working with ORMtnMan and a few others on replacing all of the models in his mod.

The only downside is two mods will be incompatable unless you open up the class and paste in the model definitions from the other mod(s)

If someone wants to do it, a public model resource collection and the requisite ModelManager could solve that. Models are small enough (a few MBs at most) that people could just download every model from every mod and there wouldn't be any need for regular players to mess around with files.

 

Is there a model manager program mentioned above available for replace/add new models into the game? Or is it possible that we can add new weapon/item model through a mod?

Link to comment
Share on other sites

Is there a model manager program mentioned above available for replace/add new models into the game? Or is it possible that we can add new weapon/item model through a mod?

 

There is a mod that allows you to add models to the game. It's called ModelLoader. The forum topic is located here:

http://theindiestone.com/forums/index.php/topic/14845-b3216-v109java-modelloader/

Link to comment
Share on other sites

 

Is there a model manager program mentioned above available for replace/add new models into the game? Or is it possible that we can add new weapon/item model through a mod?

 

There is a mod that allows you to add models to the game. It's called ModelLoader. The forum topic is located here:

http://theindiestone.com/forums/index.php/topic/14845-b3216-v109java-modelloader/

 

Thanks

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...

I stalled on completing these scripts due to lack of time, and considered waiting on the animation updates possibly in 34, as to not waste time reinventing the wheel. 

 

I might be looking into working on this again soon though.

Link to comment
Share on other sites

  • 1 month later...

I don't want to math. Mathing is hard. :|

 

Sure, I have animations loading into Blender, however, now I need to reverse the process for exporting animations, and I feel like this is going to take a lot of work. 

 

I'll be looking into this though. 

Link to comment
Share on other sites

The Blender scripts have been updated to 2.76b. 

 

ANIMATION EXPORT SUPPORT IS ADDED TOO!

(Edit: There's problems I'm working on atm that I found out after this post)

 

The only thing stopping me (From what I have tested & verified at this point), from importing animations in the game is adding this feature to ModelLoader.

 

I also am able to export Skeletons too. I simply have not implemented this yet.

 

 

I will be also modifying the scripts to export to new formats, being the following:

 

.PZM (Mesh)

.PZS (Skeleton)

.PZA (Animation)

 

(There will be a definitions file .PZX)

Edited by Jab
Link to comment
Share on other sites

  • 4 weeks later...

Update:

 

Not quite sure how long it will take to properly export animation data, but I have been working to get there for a few days.

 

Once animations and skeletons can be exported, then work can begin on tidying up the scripts, and forming a plug-in around them, as to make things easier.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
On 6/13/2017 at 10:02 AM, ZaBrat said:

Help me someone plz.  Size of my crowbar is too big and it does not depend on the size of model in blender. I repeat after videoguide and that is my result:

Try applying location and size to the model in Object mode. If you change size and location in edit mode it doesn't apply until you apply it.

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
On 13.12.2017 at 1:55 AM, tommysticks said:

What do you mean? You want the male character model with his hands down? More details needed.

I mean this image.png.e00815e8cd9889b197a59ab93a9c38c1.png
There is no difference between a man or a woman (model)

Edited by ZaBrat
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
  • 1 year later...
  • 4 weeks later...

Hihi, I spent today getting these scripts working for blender 2.79 and learning a bit of python/blender scripting for them, I have the import/export working (mostly), I haven't tested exporting with the script and using that model in game because I am learning still how to do that. Sorry these are not perfect or anything, let me know if something breaks, I am slowly fixing what I can as I learn. 

 

An important thing for IMPORTING so please note, as of right now importing via the context menu will not work, you must run the addon as a script to import a mesh, exporting should be fine. To run import script in blender, change to the 'Text Editor' View, then open the ZomboidImportNew script and click run, then you will be able to chose a model to import.

 

also note, because i don't know how to import a model into the game yet, i can't check if materials or textures will export correctly, if anyone has something i can look at to learn to import into game faster that would be great, i have been self teaching/reverse engineering everything so far :(

 

I have put the scripts here for now; https://github.com/rundaaa/ZomboidImportExport

 

please remember they are work in progress, and basically completely all of Jab's work still, just reformatted for 2.79! Thanks!

 

Edit: i have started updating the scripts to 2.8x (2.9 as well) but there is much for me to learn with that so don't expect them to work well, basic mesh import/export seems to work so far, added on the github !

Edited by Rundaaa
2.8x addition
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...