offtools / BLive

Blender addon which allows to control the gameengine from a blender session by using OSC, it monitors changes in blender and send them to the gameengine. To try out download v0.1.2 newer code will not work because of network code rewrite.
14 stars 4 forks source link

Can't import Liblo #5

Open forresthopkinsa opened 8 years ago

forresthopkinsa commented 8 years ago

No matter what I do, I am totally unable to import Liblo into Blender. Has anyone managed to do this with Blender 2.77? I've been messing with this all day, and I keep running into dead ends.

offtools commented 8 years ago

Hi.

which OS are you using? can you try to import liblo manual in the blender python console and post the output?

thanks

forresthopkinsa commented 8 years ago

Ubuntu 14.04 LTS. Running in a Crouton chroot on a Chromebook. x64.

Okay. So I made a little bit of progress over the course of several hours yesterday:

apt-get wasn't working for me for Liblo. So instead, I installed Cython and then compiled Liblo manually.

But Python <= 3.4 won't work with Blender 2.77. You need Python 3.5. So, I had to apt-get install python3.5 python3.5-dev before building and installing the setup.py inside Liblo.

After all of that was done, then Blender would import Liblo. (FINALLY, I didn't even have to append Blender's sys.path!)

When installing BLive, Blender appropriately unzipped the plugin just by selecting it in the plugin dialog, and it seemed to work from there, although I've yet to actually test the plugin. I'm going to mess around with it a bit and report back.

forresthopkinsa commented 8 years ago

As soon as I tried to start the GameEngine, I got a FileNotFound error. Apparently the plugin is looking for the Global addons directory, whereas Blender by default installs addons into a user-local directory.

So, I had to copy my local addons directory to where BLive was looking for it:

cp -R /home/forrest/.config/blender/2.77/scripts/addons /usr/share/blender/2.77/scripts/modules/addons

After that, I got another error that I don't think can be fixed by moving files around. See the image below.

blive debug 3

(It should be noted that my end goal here is to get a visualizer for QLC+)

forresthopkinsa commented 8 years ago

Okay, so I fixed that error by changing this line in utils/utils.py:

for j in bpy.path.module_names(path, True):
       if bpy.context.user_preferences.addons['blive'].module in j[0]:
             return os.path.dirname(j[1])

to be:

for j in bpy.path.module_names(path, True):
       if bpy.context.user_preferences.addons['BLive-master'].module in j[0]:
             return os.path.dirname(j[1])

Although now, I'm having a different problem. Now, it's throwing this error:

File "/home/forrest/.config/blender/2.77/scripts/addons/BLive-master/common/ops.py", line 144, in execute
self.add_logic(sc)

File "/home/forrest/.config/blender/2.77/scripts/addons/BLive-master/common/ops.py", line 93, in add_logic
sc.camera.game.sensors['s.update'].frequency = 0

AttributeError: 'AlwaysSensor' object has no attribute 'frequency'
forresthopkinsa commented 8 years ago

Okay, so, uh, I'm not sure what that line of code -- the frequency one -- is supposed to be doing. So, I went through the children of sensors['s.update'] and found one that was an integer: tick_skip. I have no idea whether that is what frequency is supposed to be, but I exchanged them and now I can actually achieve the BGE window. Hooray!

In summary, I changed:

sc.camera.game.sensors['s.update'].frequency = 0

to:

sc.camera.game.sensors['s.update'].tick_skip = 0

And it made it past the part it's been getting stuck on.

I'll do some more testing and let you know what I find.

forresthopkinsa commented 8 years ago

Okay, I've got it somewhat working. There are some weird things... for example, if I try to right-click that cube in the scene, Blender hits a segmentation fault, but that's alright.

How did you go about sending QLC data to the OSC server?

offtools commented 8 years ago

Hi,

the plugin is a bit outdated. Nice that you brought it to life again. For the qlcplus -> blender connection I added a second OSC server. You find it in the Scene Tab of the properties Window. You can connect DMX input (via osc) with properties of objects in blender. I'm not sure, what the status is and if its working right now.

The crash is odd. Are you in Object or Edit Mode?

offtools.

forresthopkinsa commented 8 years ago

Object mode. It's pretty weird... when starting the gameserver, the cube is a secondary selection. If I right click it to primary select it, then Blender crashes, blah blah blah.

Weirdly, even if I close the BGE and then try to select it, it still crashes.

I'll post the stack trace when I'm in front of my computer next (I'm on my phone at work currently). I'll also check out the second OSC server then.

forresthopkinsa commented 8 years ago

Okay, so apparently when I updated Blender, it lost compatibility with my video card. That was the reason for the segfaults. Sorry for the false alarm.

I got it working using the softwaregl script.

Testing more... also, implementing the fixes above. Sending a pull request sometime this week.

forresthopkinsa commented 8 years ago

Okay, so I don't think I totally understand.

I set QLC to be sending output to OSC on 127.0.0.1, on port 9901:

blive 5

I test this with an OSC monitor -- I am, in fact, sending data values to localhost when I change things in QLC.

In the BLive panel in Scene, I create a property on channel 1. I'm not entirely sure what to put in for that property, so I set it to Object: Cube, and tell it to modify the property location[0], which should change the X-value:

blive 4

I start the game engine, go into QLC, make sure it's sending, then send various DMX values to BLive, and... nothing. Nothing happens. I'm pretty sure I'm making a mistake in that DMX patch panel, but I can't tell because there's no documentation for that.

Could you give me a hand? Thanks for all the help!

forresthopkinsa commented 8 years ago

If you just uploaded an example .blend, that would be totally helpful

forresthopkinsa commented 8 years ago

Praise God, I got it to work!!