Tabs aren't recognised in some scripts

I tried to use the POVRay export script but got an error (it’s not recognising the Blender objects - could be a version incompatibility). I tried to fix it by adding some lines but when I tab the new code, I get syntax errors. I have to press spacebar 4 times for each tab.

Tabs work fine in scripts I make myself. Could this be a platform issue because I’m using Mac OS X? Maybe I need to change the tabs in an external editor.

BTW, you may already know this but they released a new POVRay (3.6) for Mac. About time I say, they didn’t bother to fix a minor interface error for ages. Were they trying to stage a one team war against OS X or something? In the docs they would say things like OS9 had much higher performance and was therefore recommended. I’m glad they saw the light because it’s a good renderer.

if you are using this one :
http://jmsoler.free.fr/util/blenderfile/povanim.htm
Just read the docs.

could be a version incompatibility). I tried to fix it by adding some lines but when I tab the new code, I get syntax errors. I have to press spacebar 4 times for each tab.

Hard life !
:frowning:

Tabs work fine in scripts I make myself. Could this be a platform issue because I’m using Mac OS X? Maybe I need to change the tabs in an external editor.

From the python doc:
“”"
Cross-platform compatibility note: because of the nature of text editors on non-UNIX platforms, it is unwise to use a mixture of spaces and tabs for the indentation in a single source file. It should also be noted that different platforms may explicitly limit the maximum indentation level.
“”"

if you are using this one :
http://jmsoler.free.fr/util/blenderfile/povanim.htm
Just read the docs.[/quote]

Ah, I was using a different script. I’ll give that one a go.

[quote] could be a version incompatibility). I tried to fix it by adding some lines but when I tab the new code, I get syntax errors. I have to press spacebar 4 times for each tab.

Hard life !
:([/quote]

Yeah, ok it’s not a big problem but why does Python declare a syntax error? It took me ages to figure out what was wrong. If it had just said cannot mix tabs with spaces or something.

It’s a syntax error because indentation levels are not as expected.
4 space characters is not the same as one tab character.

Martin

well download SCITE http://scintilla.sourceforge.net/ScintillaDownload.html and it will show you exactlypreciselyundoubtedly (in blue color) where are probs with mixed spaces/tabs in your scripts.

then, you can either
a: convert tabs to spaces and fine-edit your scripts yourself (e.g. with idle)
b: manually fix problematic lines

because of low standard of code-cleaneness with blender python scripts posted here and there … , I did this over time with all scripts I use and I also prefer to manually upgrade (wherever possible) scripts I use for newer blender versions. btw. a lot of scripts can mess up formatters as trita quite easily

It would be wise (regarding many aspects and user-friendliness) if there’d be an effort to incorporate blender-optimized auto-code-formatter (like flash has, for example) into main blender app.

but then again, blender-dev headquarters might as well have different views to that.

regarding mac problems - wasn’t there company slogan going something like think different

There’s not a Mac version for this, though the linux source might compile but it doesn’t matter much. It was just that some people new to programming Python (me) might be put off by entering simple code that they know is absolutely correct to be told there is a syntax error. It drove me mad, I kept looking at the line thinking ‘but there’s nothing wrong with the line print(“hello”)’.

This project might be about that. I like the idea of syntax colouring too:

http://projects.blender.org/project/shownotes.php?release_id=64

And just what’s that supposed to mean? I hope you’re not taking a stab as us Mac users tedi. There’s no need to get all jealous because we have the most technologically advanced system in the universe :wink:

A port of BSD Unix? Talk about leading a sheltered existance.

hehehehehe - that’s the proper macuser spirit :stuck_out_tongue:

no, see, I have freeBSD(and windoze, of course …) running on my intellistation (not the latest, but … it’s summertime :stuck_out_tongue: )

but - something has always bothered me - IF mac platform is so superdupersuperior_to_blasphemy - how come kraftwerks (symbol of electro-age ???) are touring with centrino laptops and I hear apple-shake gets more around in it’s linux incarnation ?

but, yeah, people are people and the un_alluminated majority just doesn’t seem to see the light, right :slight_smile: . but, speed-metal looks mighty good, to be honest!

except I don’t like eyecandy os’s at all.

but I’d very much welcome some auto-code-formatter built-in blender.

You’re right, Apple owes it all to the unix guys. But it’s the elegance with which they’ve put it together that makes it stand out. I mean, how many variants of Linux are there, like 20? And how many could I use without troubleshooting all the time? Very few.

I think it’s a hardware issue. Apple’s laptops haven’t moved into the fast lane like their G5 desktop counterparts yet. Their newest ones are still only at 1.5GHz (not that MHz & GHz matters, of course - “think different”, hehe) but G5 laptops will come eventually.

Hmmm, it would be nice but I think Blender developers tackle the big issues first so I don’t know if it will be soon. I suppose someone could just write a Python script to do it, couldn’t they? I prefer to do it manually myself. MS Word has put me off auto-formatting for life.

not that MHz & GHz matters, of course

yowza, yowza, but of course, just look at THESE http://www.sgi.com/workstations/tezro/ … still at 800 MHz - but boy, it woul FIT in scenery of ANY Jules Verne story - movie - whateverwhenever …

f**kin beautiful …

Yeah, it’s more to do with throughput than clock speed. Apple and a few others including AMD (I don’t think Intel, though) are members of the hyper-transport consortium, which now try to focus on general computer bandwidth. That’s why G5’s have 1GHz DDR Ram. I mean, the XBox only has a 700MHz PIII but its graphics are ok. It just depends on what it’s used for.

I’m not much into the wacky designs (says someone who used to own the old style imac %| - well it was just the indigo one) like the alien PCs. That SGI workstation’s not too bad but I prefer the titanium, conservative style. That’s why I didn’t get the old style ibook but waited for the new one because I couldn’t stand the ugly luminous colours. I like the idea of the G5 having no visible wires too and liquid cooling is just the icing on the cake.

The spec looks nice on that workstation, though. Up to 4x800MHz 64-bit processors and nice graphics options. Unfortunately, those kind of machines usually cost a fortune. I’ve seen fairly mediocre looking spec workstations at over £32,000. Also, I’m a bit wary of multi-processor machines because I find that few software packages support them, some don’t even take advantage of the 64-bit processors.