Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Website hosting blender python scripts is gone?

Author
Message
Eliseee
10
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 7th Sep 2010 18:22
I just reinstalled DBC on my new computer and started to mess with it to see what I could do, and it's quite fun. But I ran into problems with .x models again (trying to get an AK74M I put together quickly into DBC):

I remember I got Latch's blender exporter to work after alot of fiddling, but the links to it seem to be down. Does anyone still have it? Alternatively, does that other DBpro exporter also work with DBC? I assume not, the file said "DirectX9".

I tried using the blender built-in exporter, and it looks fine, as long as my model is not animated. If I wobble it around a bit to make an idle animation and export it w/ animation, it basically explodes, the normals are flipped inside out and vertices are all over the place.

(I didn't use bone animation, I made one mesh for the gun itself, one for the magazine and one for the bolt carrier, then parented them all that first gun mesh, as I remember limb animation is the only thing that works)

If I join all the meshes together and try to animate only that one, it just tells me the model can't be animated (?).

Is it because you can't move limbs around and can only rotate them? I don't know, but anyways, I remember Latch's exporter working pretty well once I figured it out. If anyone could reupload it somewhere, I'd be really thankful.

~~~
Eliseee
10
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 7th Sep 2010 22:18
Hahaha, I'm an idiot, the DX9 scripts work great. Still though, out of curiosity, if anyone still has Latch's scripts floating around on their HD, reupload if you can!

~~~
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Sep 2010 00:56
Quote: "Still though, out of curiosity, if anyone still has Latch's scripts floating around on their HD, reupload if you can!"

Hi Eliseee,

I appreciate your interest in that script. I had continued updates on it for a while and got it to a point where it worked perfectly well at least up to Blender version 2.45 or 2.48 (I think).

Unfortunately, that version of the script was never released, and I no longer offer the script publicly because I've bundled that and other scripts together in an unorganized conglomerate of code I use to manage many tasks with Blender and DBC. It's all a work in progress that hasn't really made any progress, but works for me because I know what value to put where. I hope you aren't too disappointed - but it would seem that you have a solution.

I wonder if the DX9 script you are talking about is the one that Kira Vakaan has been working on. I've never tried it, but from what I read it seems to be pretty good. I don't know if it handles limbed meshes - perhaps it does if it's the one you are talking about:

Direct X exporter

Enjoy your day.
Eliseee
10
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 12th Sep 2010 13:06
That would be the one I was using, but, after playing with it for more than 5 minutes I now realize I still have weird problems with parented objects appearing in seemingly random locations that have nothing to do with where I place them.

Just for testing, I made a quick hand model, applied transformation on everything, placed it all, parented it and exported it with Kira Vakaan's exporter. Instead of appearing correctly everything is blown up all over the place and outstretched- much like the problems I originally had with your scripts. I completely forget how in the hell did I ever fix that though.

It appears that there's always an offset applied to the childs from the world origin instead of from the parent's origin, so they appear twice further away as they should be. If I reset the object's position with alt g, it will appear lined up with it's parent's origin, except with a vertical offset which looks like the distance between the parent and the world origin. If I reset the child's origin with alt-o, instead of appearing at the parent's origin it actually does not move except for an extra vertical offset as with alt-g.

I cleared parenting for all my objects, moved my first parent to the world origin and then parented only one limb to it. Now, it looks more or less fine except the limb is slightly too far (barely) and all the other non-parented limbs are garbled all over. If I remove the non-parented limbs from the export it now looks fine. But if I parent any more limbs down from that, they appear all garbled and all over the place again.

This is confusing!

~~~
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Sep 2010 18:57 Edited at: 13th Sep 2010 03:41
Quote: "It appears that there's always an offset applied to the childs from the world origin instead of from the parent's origin, so they appear twice further away as they should be."


Hmmmmm....

Sounds like you're having a bit of a problem with the pivot points of your limbs. You may be aware of everything that follows, but for good measure see if following these instructions help. A quick definition of what I mean by the pivot point:

This is the point a mesh will rotate around. This also defines where the mesh limb will be placed relative to the origin OR a parent limb. For example, the lower arm of a humanoid figure would hinge at the elbow. If the figure were facing the camera, and the right arm was extended 90 degrees to it's right, the pivot point for the lower arm would be where it connects to the upper arm. (see attached)

To set your pivots, try this:

Object mode:
1. Right click on the limb you wish to set the pivot point for.

2. Select Object > Transform > Center New
This will place the limb's (the current object) pivot directly at it's own center. Now we want to snap the 3d cursor to this location so we have a good starting point for setting the pivot where we want it:

Object > Snap > Selection --> Cursor

3. LEFT click where you actually want to place the pivot for the limb. In our example, it would be where ever the elbow is. The LEFT click should place the 3d cursor (the target bullseye thing) where we want it.

4. Change to various camera views using the numeric keypad or the View > menu item. The goal is to make sure that the pivot is placed correctly in all views - you don't want the 3d cursor lined up correctly on the x axis but it's 10 miles away from where you want it on the z axis!

5. Once you have the 3d cursor placed where you want the pivot to be, click on Object > Transform > Center Cursor

6. Set up the pivots like this for all of you individual limbs, making sure you place the points where you want that limb hinged.

7. If you already haven't done this, position all of the limbs that are set up with their correct pivot points in their correct positions - building your final character.

8. This is very important:
BEFORE creating the parent child hierarchy, you have to set the rotations of each limb to a default of sorts. This means that at whatever rotations you have used to get the limb to it's current position, you have to "Fix the pivot rotation" to 0,0,0. Fix in this case, means "set in stone"

Check this by:

1. Right click on a limb to select it
2. Press the N key to bring up the Transform Properties box
- You are likely to see values other than 0.0 for RotX RotY and RotZ
Even if the values read 0, follow the next steps:

Fix the rotation by:
1. Make sure that the limb to fix the pivot rotation is selected
2. Press CTRL+A and agree to apply the scale and the rotation
3. You should see the values of Rotx Roty and Rotz in the transform box switch to 0

After all of the pivots are set, and all of the rotations are fixed, link up the hierarchy.

9. Link the children and the parents by Right clicking on the CHILD, HOLD SHIFT, and Right Click on the parent. Then press CTRL+P

Link the limbs 1 at a time. You'll run into problems if you try to link multiple limbs at once to a parent. 1 child, 1 parent at a time.

Hopefully, this will correct the offsets you are mentioning. I just downloaded and tried the directx9 exporter for blender 2.49, and it exported one of my characters correctly, though I didn't try any animations.

Enjoy your day.

Attachments

Login to view attachments
Eliseee
10
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 18th Sep 2010 00:04 Edited at: 18th Sep 2010 03:05
I figured out what my problem was.

It didn't have anything to do with what you mentionned- it was actually just that I was creating LocRot frames instead of only Rot. That's so confusing, though, since I've only done animation with the armature system before, I assumed locrot when the limb would be in the default distance from it's parent anyways shouldn't displace it! Is this a problem with the plugin or blender? The animation looks fine in blender with those LocRot frames. Anyways, I just thought of that and replaced all the frames with only Rot and now it looks just fine (so far...). Does that mean displacing limbs using Loc frames in general is out of question? That sounds very strange.

Anyways, thanks for the help! I should probably ask Kira Vakaan about this, it might just be a bug.


... Oh and actually, nevermind, it still does not work. I can get the first arm to animate and everything fine, but if I parent anything to that, or even just add any limbs at all it just scatters everything all over the place. Oh well! I'll figure that out eventually- what a headache, though.

~~~

Login to post a reply

Server time is: 2020-08-12 02:23:22
Your offset time is: 2020-08-12 02:23:22