Jump to content
Jab

Blender 3D Scripts

Recommended Posts

 

I am finally working on this again.

Right now I am looking at making a model viewer in Java based off of an example OpenGL program I found to save some time, and focus on importing the model in Java first, before I attack the Blender scripts again.

If you can figure out how to add in an optional dither/pixelate effect in the model viewer, it will become incredibly useful. Trying to gauge what details will be lost in-game is difficult at best.

 

 

First I need to get animations properly loaded. :P 

Share this post


Link to post
Share on other sites

There a way to modify the male and female models and export them so they work in game?

 

That's what I'm currently trying to solve. I'm not too informed as to how Blender's matrix system works. I've read the java code for animation countless times. I've tried countless times to implement a parent-child matrix relationship successfully in Blender, and have failed. I'm really wondering if I'll ever get this right. It's the one thing holding me back to getting the model completely moddable, and it's held me back for months. I also tried to get some insight on this, but neither Blender community through IRC or TIS could help.

 

This is just one of those problems I might not get solved. I'll keep trying though.

Share this post


Link to post
Share on other sites

Quick question, hoping someone knows this. I made a load bearing vest, backpack, and hat in blender and replaced the "chops" beard style with my model. In-game when I rotate around to where the backpack should be visible from behind it becomes transparent. Anyone know why this is happening? Picture attached.

 

backpack.jpg

The line on his back in the right picture is a strap on the LBV seen through where the backpack should be.

Share this post


Link to post
Share on other sites

Quick question, hoping someone knows this. I made a load bearing vest, backpack, and hat in blender and replaced the "chops" beard style with my model. In-game when I rotate around to where the backpack should be visible from behind it becomes transparent. Anyone know why this is happening? Picture attached.

 

backpack.jpg

The line on his back in the right picture is a strap on the LBV seen through where the backpack should be.

 

well certain parts of the body move differently in animations. Nice job though with the hat. Yeah right now changing the body model is possible, just you'll have to do some text editing work ontop of exporting model data separately, which is a pain. 

Share this post


Link to post
Share on other sites

Continuously researching ways to fix the animations without a clear guidance to the format is probably going to either dramatically delay animation loading further out into the distant future, or nothing will come about at all.

 

Even though the format yields the datatypes, and the decompiled source yeilds the construction of the matrices, There is no clear way to establish an explicit understanding of the *right* way to calculate these rotations. I'm importing a GLOBALLY Y-Up defined mesh into a LOCALLY, parented Z-Up 3D environment. Without understanding what the model wants me to do exactly, I'm lost in both the Blender realm as well as being shrouded in not knowing what these numbers actually represent.

 

I really need to know more about the format in order to complete this script. Playing around with the numbers isn't helping.

Share this post


Link to post
Share on other sites

Continuously researching ways to fix the animations without a clear guidance to the format is probably going to either dramatically delay animation loading further out into the distant future, or nothing will come about at all.

Even though the format yields the datatypes, and the decompiled source yeilds the construction of the matrices, There is no clear way to establish an explicit understanding of the *right* way to calculate these rotations. I'm importing a GLOBALLY Y-Up defined mesh into a LOCALLY, parented Z-Up 3D environment. Without understanding what the model wants me to do exactly, I'm lost in both the Blender realm as well as being shrouded in not knowing what these numbers actually represent.

I really need to know more about the format in order to complete this script. Playing around with the numbers isn't helping.

Is the 3d part of the engine from any kind of resource library, or at least dependant on one? I think its a bit far-fetched that whoever implemented 3D just pulled the whole thing out of their ass. But then again, stranger things have happened. If you can find out where the model handeling comes from, it might have answers for how the animations are handled.

Share this post


Link to post
Share on other sites

Thanks to Captain Binky's insight on the format he wrote, more progress has been done in 2 hours, compared to the last 4-5 months of work I've put into this script. 

 

The biggest issue seems to be the way I built the skeleton. Position isn't enough, and certainly the rotation I thought I had right. It was a composition of my failure to use the Blender API as well as respect the nature of the format.

 

Much thanks to Binky for the such long-needed insight.

 

Picture of failure & progress: 

 

iwhI6cWY5f1bp.png

Share this post


Link to post
Share on other sites

Updated the scripts. The import script should have a more accurate armature. It's not entirely correct, but closer to what it needs to be.

Sooo should we expect animations soon? lol

 

Maybe.

 

 

EDIT:

Updated the Import script. Forgot people are working in Z-Up, and my progress is being done in Y-Up.

Share this post


Link to post
Share on other sites

Updated the scripts. The import script should have a more accurate armature. It's not entirely correct, but closer to what it needs to be.

Sooo should we expect animations soon? lol

Maybe.

EDIT:

Updated the Import script. Forgot people are working in Z-Up, and my progress is being done in Y-Up.

Does this mean weights will be accurate now? I spent the last day trying to figure out why clipping kept happening in-game but not in Blender.

Share this post


Link to post
Share on other sites

 

Updated the scripts. The import script should have a more accurate armature. It's not entirely correct, but closer to what it needs to be.

Sooo should we expect animations soon? lol

Maybe.

EDIT:

Updated the Import script. Forgot people are working in Z-Up, and my progress is being done in Y-Up.

Does this mean weights will be accurate now? I spent the last day trying to figure out why clipping kept happening in-game but not in Blender.

 

 

Didn't change weights. I did change some code for the vertex position on export, trying to fix that one flip bug. Also, the exporter uses the vertex position in object space, not in global. Use Ctrl + A in the viewport and apply location, rotation, and scale, before exporting. I'll have a fix for that when I'm not too concerned about the animation code and things have progressed.

 

If you have any questions, feel free to hop on #pzmodding on the Dalnet IRC server. :)

Share this post


Link to post
Share on other sites

Heh. It's no doubt that I have made progress, however, 

 

Although the rotations of each bone are seemingly correct, my skills at matrix transformations are still noobish, so the bones rotates, however, they don't rotate the children bones, so all the bones are sitting in the 'Bind Pose' rotating their butts off without changing others. It's kind of funny, however, really annoying.

 

If you want a peak at it, feel free.

 

Here's the script thus far: (Run animation)

http://paste.ubuntu.com/12091343/

 

So I'll need to figure out why the bone matrices are not exchanging location offsets to their children. 

Share this post


Link to post
Share on other sites

The next steps are to clean up my current version of the script, and resolving an issue where the animation AND the mesh are loading in where the right side is on the left side. Strange indeed.

 

After that, it's loading the animations into dope-sheets for Blender's Animation tools.

 

After that, cleaning again, probably.

 

And after that, It will be exporting the skeleton and animations.

 

I think after this phase, it would be maintenance and up-keep for the script, and being released as fully functioning. 

 

The thing is though, after I get these imported into blender, they can easily be carried on to another format, so the sky is the limit in that respect, honestly.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...