python-console

Have you ever found yourself needing to change a .blend file remotely and VNC / Remote Desktop is not working?

In my case I finished rendering the left eye of a video, and wanted to do the same for the right one. I did it in parts due to the memory limit of the rendering station. And VNC is not working because … no idea. But it’s Friday and I won’t have physical access to the remote computer until next week.

Blender Interactive Console to the rescue!

$ ssh MY_REMOTE_COMPUTER
$ blender -b MYFILE.blend --python-console
(...)
(InteractiveConsole)
>>> import bpy
>>> bpy.context.scene.render.views['left'].use = False
>>> bpy.context.scene.render.views['right'].use = True
>>> bpy.ops.wm.save_mainfile()

Now all you need to do is resume your tmux session, and kick-off render once again. For different Blender command-line options try blender –help.

This post is obviously based on real events! Have a nice weekend 😉

all rights reserved (c)
Hello there. After nearly two months I’m back 🙂 I left Canada and I’m in Brazil (more specifically Rio de Janeiro for the time being). Today I went hiking. Some tourists may know “Pão de Açúcar” (Sugar Loaf), one of the famous sightseeing attractions here.

Not only you can take the as-seen-on-007-movie cable cars to get to the top, you can also go hiking there. It’s a lovely view from through the entire circuit. You do need someone experienced to walk you through, since some of the passages require climbing material.

all rights reserved (c)

A mosaic made with Blender – just so we stay on the blog’s topic.

bbc_01

bbc_02_pano

bbc_03Not only beautiful, but one of the few places in the world where you can bike around, enjoy the view and do some coding without any safety worries. I will certainly miss that.

Now, what an interesting timing. In Brazil riots are taken place for reasons I not only vouch for, but would love to take part on. If your local news is not covering any of those, do check the links below for more information.

As a curious contrast, in Vancouver the last riots were thanks to … Stanley Cup (hockey competition). Were they protesting against the abusive expenses in renewal stadiums, privatizing the public space, the lack of counterpart for the population? No my friends, the “protests” were due to the poor performance of the Canucks in the cup. What?!? Yup, go figure.

Meanwhile in Brazil:

Err not really, backup often kids ;). To add it up to my recent tragic Windows 8 destroyed my OSX partitions story I actually have ordered an external hard drive but it arrived one day after my HD was messed up.

Now time for some good news: I just fully recovered my HD. I would like to thank all the help I got over here, G+, email. Really, thanks big time.

So that’s what I did (in case you are here googling about the same problem). I’m assuming that if you got that far in the internet for help, you are already as doomed as I was. So I won’t even bother with warning and re-warning you that you are better off seeking professional help.

1) 2012 is the year of the penguin, but not. But still, Linux still rocks. I have no Mac-to-Mac cable at hand so I had to resort to a rescue live CD. The party wouldn’t be complete without an OS-threesome after all.

So I first tried Ubuntu Rescue Mix but it didn’t come with the application that I was suggested to try (namely gdisk), so I used it only for diagnostic and the dump backup. In the end I downloaded GParted which comes with a nice X11 btw (though you will inevitably use the console, so don’t get pumped it up ;))

2) dd if=/dev/sda /media/usb7/sda_backup
First things first, jokes aside it’s never too late for a backup. I started with a byte backup of my 500GB. It takes time, as in, really. 30 hours later I knew there was nothing I could do to make things worse. If anything I could reverse the dd if/of order and restore my HD to the broken state I was getting familiar with. And there is nothing like Mario U to endure 30 more hours if it comes to that 😉

*) As for everyone’s suggestions I tried gdisk, but my system was too corrupted. It had no internal backup (what you get from using ‘c’ from gdisk) and the error message I got (something about overlapping partition sectors) was stopping me from doing any change in the partition and write it back. I thought it could be a conflict between the MBR Windows tried to write and the GTP created by Mac, so here for a more radical next step:

3) dd if=/dev/zero of=/dev/sda bs=512 count=1
WARNING: This will clean up the first 512 bytes of your partition, namely the boot sector. Note, this may not be necessary, but I was already in the verge of resetting my system. I went back to gdisk to see if that worked, and in fact the MBR was gone. I quitted gdisk because it wasn’t his turn anymore. Welcome the star of the night:

4) It’s fdisk magic time 🙂 I don’t know what to say. A few [enter]s and I had my HD back up and running. This console based program (that comes with GParted, OSX, and any Linux as far as I know) is great. It prints the partition types correctly, list all the files in the Windows partition, and even allowed me to copy them out if needed. Since my Windows had nothing special I turned to the OSX partition and, although file listing isn’t supported, just asking it to fix it solved the problem. I’m not kidding, it took me less than 5 minutes.

Final considerations: I just wished the personal at AppleCare phone line could have drove me through that. They pretty much got me hopeless to the point that I didn’t even bother dropping my computer at an AppleStore.  If I had the time I would get my broken backup back (from [2]) to the laptop to see if the Apple Store crew would have fixed it :p

And that’s all. I hope this turns useful to someone. And again, thanks everyone for the help I got. Very much appreciated. And yes this post has tons of smiles. That looks like me through the entire day 😀

I’m just back from the Siggraph Asia 2012. I was impressed by the people I met, the talks and courses I attended, and why not, the places I visited. Singapore is a very interesting city for a tourist. Among the people I met, a particular meeting was long overdue. I finally had a chance to meet Paul Bourke personally.

We collaborated (meaning he helped me ;)) in the fisheye implementation for the Blender Game Engine back in 2009. Since then there is not a fisheye related question that I don’t bounce by him first. So, in between talks he kindly shared his thoughts for stereoscopic rendering for domes. It took me a week to work around the problem, but here you can see the first real renders in a patched Blender with Cycles.

The formula is very simple, it’s just one of those problems that is really hard to debug (at least when you don’t have a dome with 3d projectors at hand). Thankfully in my flight back I had the peace of mind to wrap that up.

3D Model The White Room cortesy from Jay-Artist, shared on blendswap.com

As a teaser, this is all you get for now. More on that later 😉

[edit: problem solved, see here]
I’m in the verge of loosing some important data which I would like to avoid by any means.
So this is my last hope. Can you, dear internet souls, advice me into some reasonable solution?
Basically I installed windows 8 through Bootcamp with a 100GB partition.
I then decided 50GB would be enough, and from inside windows I shrinked the partition from 100GB to 50GB.
That left me with a 50GB unallocated partition. So I clicked in the partition (again, from windows8 disk utility) and ask to format it to exFAT.
Now the problem: windows asked me to assign a letter to it, and  I picked the first one avaiable. As it turned out this was taken (by the Mac I suppose) and windows did something strange. From that point on I could no longer see my OSX partition in the boot window (the one I see when keeping alt/option pressed). I couldn’t even boot on windows (it jumps to some Windows auto-repair attempts loop which now I regret may have only made my situation worse).

Oh God … Blue Screen of Death revamped?

Now the troubleshooting part:

If I boot up with a MountainLion USB boot stick (thanks PB!) I can go to the Mac Disk Utility and see three partitions in the HD (400GB, 50GB, 50GB). The first one (400GB) was supposed to be my OSX partition, but it says:

Mount Point : Not mounted
Partition Type: Windows_LDM
Capacity : 400.86GB
Available :
Used :
Now if I boot up with Linux (Ubuntu Rescue Mix live dvd) and try any of the basic recovery commands I get:
Error:  Both the primary and the backup GPT tables are corrupt. Try making a fresh table, and using Parted’s rescue feature to recover partitions.
Any hardcore suggestion? I’m accepting anything from linux hacks to redo the GPT table forcing it to match my original ideal tables, or mac or, …
I don’t care about the windows partitions, so for me they are as good as dead. I’m only concerned about the OSX data.
I remember from my days of Linux that I could try to force a change of partition type without reformatting. But that will only work if windows changed the partition type but didn’t did it properly. I’m not sure this is relevant though. I’m not even sure whateheck a GPT table is …
AppleCare is not much more helpful (they are nice to speak with, but didn’t get very far). So the internet is my last hope …
Thanks a lot, any help is appreciated 🙂

The talk starts at 16:00 Amsterdam time (14/October/2012)

In less than half an hour I’m presenting a talk at the Blender Conference 10th years anniversary edition. The presentation will be streamed online, and if you want to follow the presentation with the slides I will use, you can download it here.

An Open Source Framework for Photo-Realistic Render of Synthetic Elements in Captured Panoramas

Dalai Felinto⋆, Aldo Zang† and Luiz Velho†

⋆ Fisheries Centre, UBC – Vancouver, Canada † Visgraf Laboratory, IMPA – Rio de Janeiro, Brazil

 

Slides: http://www.dalaifelinto.com/ftp/bconf2012.pdf (16MB)

Main page: http://w3.impa.br/~zang/blenderconf

Streaming: http://www.blender.org/community/blender-conference/

 

Panorama results:

Panorama captured in IMPA – Visgraf

 

original panorama from http://www.blendedskies.com

 

To better appreciate the panorama images you can download the following free panorama viewer apps for smart-phones:

From time to time I go to re-visit some projects I keep track of. This week I resumed working in a BGE (Blender Game Engine) project and decided to test if the file would work online. How so? Burster is a webplugin for the BGE that allows you to embed (and even secure) your .blend files in a website.

Burster got some really good upgrades lately, and not it works as a plugin is expected to (it tells the user a new version is online, suggest it to update, …). So what you see next is a screencapture of the Nereus Program (the project I’m working on, aka my day job) website.

BGE embed in a webpage, cool

 

Where you see this Baltic Visualization box, it’s a BGE application running. Cool, right? Before someone ask if this is all realtime let me explain. This is a fancy videoplayer made in the BGE to play videos (also made with Blender, but not necessarily). It’s all about point-click, animate, sync videos, … Next you can see the same file running in the BGE with Physics debug on.

Physics Visualization on

In order to have this going I had to:

  • pack all the textures in the file
  • open all the external scripts (originally in //scripts/) in the Blender Text Editor
  • remove all the ‘from . import’ from my scripts (the modules were calling each other)
  • fix all the python module controllers:
import bpy
for obj in bpy.data.objects:
  for cont in obj.game.controllers:
    if cont.type == 'PYTHON' and cont.mode == 'MODULE':
      cont.module = cont.module.replace('script.', '')

 

Note: not all modules/python functions are supported. Read the  are Security page in the Burster plugin site.

And I did all my tests locally. Mainly because I had to hardcode the address of the videos in my harddrive. I believe it may be (or it will at some point) possible to load videos from the server. I’m yet to find the right solution for this.

For questions on Burster please refer to their website 😉

Cheers,
Dalai

What happens when an image fails to load in your system? It goes without saying that we need to find a non-intrusive way to analyze it.

It happened to me today. An image downloaded from the internet was failing to load in my project (a virtual art gallery for domes, more on that once it’s out). The internal framework involves to copy the image to the project folder and open it with Video Texture. For those unfamiliar with the Blender Game Engine, this is a python module to dynamically load and swap in-game textures.

In my tests all the images I tried were working. No exception. But of course it takes only a test-run with the client to get a crash 😉 One single image was enough to make me pull my hair.

Our beloved open image editor GIMP opens the image with no problems. In fact if I open it and save it I can open it in my project with no problems. So what’s wrong? Why can’t GIMP warn me about this problematic file?

Looking for ‘file inspectors’ I ran into this Binary File Inspector from Microsoft. It didn’t take more than a glance to spot the problem:

CMYK … Bingo! Opening the image in a station with Photoshop proved this was the issue.

For the adventure seekers out there, remember: open source tools are great. Yet you should be not afraid of getting out of your comfort zone once in a while.

Who could guess that Microsoft would be the cavalry to make it up for the lack of CMYK (and feedback) support on GIMP 😉 (or the lack of CMYK support in Video Texture, or me being short in tools for image forensics, …).

Have a great day,
Dalai

Um dos eventos marcantes do ano passado foi a BlenderPRO 2011.

É difícil descrever todas as emoções desta que foi a quinta edição deste encontro de amigos e espaço de construção e consolidação de uma comunidade que só faz crescer e me encher de orgulho de fazer parte disso.

Os vídeos das apresentações no salão principal estão finalmente
online.
(parabéns a Fernando Avena pelo trabalho de gravação e edição dos vídeos)

Acabei de rever minha apresentação e me trouxe boas lembranças. Se você tem interesse em saber mais sobre os usos de Python com o Blender o vídeo está aqui:

Se tiver com o tempo curto recomendo ao menos que assista a apresentação do Teisson Fróes. Surpresa maravilhosa conhecê-lo neste ano que se passou.
Se não conhece seu trabalho, prepare o babador e confira o site da OVNI VFX

Um grande abraço,
Dalai