crecode.com

Extending Blender with Python in Software Access barcode pdf417 in Software Extending Blender with Python




How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
Extending Blender with Python use software barcode pdf417 generator touse pdf417 in software Birt Reports Issues If your Python installati Software barcode pdf417 on directory is not in this list then you should set the PYTHONPATH variable before starting Blender.. Exploring built-in modules, the help() function The interactive Python co barcode pdf417 for None nsole is a good platform to explore built-in modules as well. Because Python comes equipped with two very useful functions, help() and dir(), you have instant access to a lot of information contained in Blender"s (and Python"s) modules as a lot of documentation is provided as part of the code. For people not familiar with these functions, here are two short examples, both run from the interactive Python console.

To get information on a specific object or function, type:. help(Blender.Lamp.Get).

The information will be p PDF-417 2d barcode for None rinted in the same console:. Help on built-in function Get in module Blender.Lamp: Lamp.Get (name = None): Return the Lamp Data with the given name, None if not found, or Return a list with all Lamp Data objects in the current scene, if no argument was given.

. The help() function will Software PDF-417 2d barcode show the associated docstring of functions, classes, or modules. In the previous example, that is the information provided with the Get() method (function) of the Lamp class. A docstring is the first string defined in a function, class, or module.

When defining your own functions, it is a good thing to do this as well. This might look like this:. def square(x): """ calculate the square of x. """ return x*x We can now apply the help Software PDF417 function to our newly-defined function like we did before:. help(square). [ 14 ]. 1 . The output then shows:. Help on function square in module __main__: square(x) calculate the square of x. In the programs that we w pdf417 for None ill be developing, we will use this method of documenting where appropriate.. Exploring built-in functions, the dir() function dir(Blender.Lamp). The dir() function lists all members of an object. That object can be an instance, but also a class or module. For example, we might apply it to the Blender.

Lamp module:. The output will be a list Software pdf417 of all members of the Blender.Lamp module. You can spot the Get() function that we encountered earlier:.

["ENERGY", "Falloffs", "G et", "Modes", "New", "OFFSET", "RGB", "SIZE", "SPOTSIZE", "Types", "__doc__", "__name__", "__package__", "get"]. Once you know which membe PDF417 for None rs a class or module has, you can then check for any additional help information for these members by applying the help() function. Of course both dir() and help() are most useful when you already have some clue where to look for information. But if so, they can be very convenient tools indeed.

. Getting familiar with the built-in editor It is possible to use any Software pdf417 editor (that you like) to write Python scripts and then import the scripts as text files but Blender"s built-in text editor will probably be adequate for all programming needs. It features conveniences such as syntax highlighting, line numbering, and automatic indentation, and gives you the possibility to run a script directly from the editor. The ability to run a script directly from the editor is a definite boon when debugging because of the direct feedback that you get when encountering an error.

You will not only get an informative message but the offending line will also be highlighted in the editor. What is more, the editor comes with many plug-ins of which the automatic suggestion of members and the documentation viewer are very convenient for programmers. And of course, it is possible to write additional plug-ins yourself.

. [ 15 ]. Extending Blender with Python You can select the built- in editor by choosing Text Editor from the Windows menu:. When you start up you are Software PDF-417 2d barcode presented with an almost empty area except for a strip of buttons at the bottom:. We can select the default empty text buffer TX:Text or create a new empty text by selecting ADD NEW from the drop-down menu available when we click on the Menu button.. [ 16 ]. 1 . The default name for this Software barcode pdf417 new text will be TX:Text.001, but you may change it to something more meaningful by clicking on the name and changing it. Note that if you would like to save this text to an external file (with Text .

Save As...

) the name of the text is distinct from the filename (although in general it is a good idea to keep these the same to avoid confusion). It is not mandatory to save texts as external files; texts are Blender objects that are saved together with all other information when you save your .blend file.

External files may be opened as texts by selecting OPEN NEW from the Menu button drop-down instead of ADD NEW. If for some reason an external file and an associated text are out of sync when Blender is started, an out of sync button is displayed. When clicked, it displays a number of options to resolve the issue.

Once a new or existing text is selected, the menu bar at the bottom of the screen is updated with some additional menu options:. The Text file menu gives PDF417 for None access to options to open or save a file or to run the script in the editor. It also presents a number of template scripts that may be used as a basis for your own scripts. If you select one of these templates a new text buffer is created with a copy of the selected template.

The Edit menu contains cut-and-paste functionality as well as options to search and replace text or jump to a chosen line number. The Format menu has options to indent and unindent selected text as well as options to convert whitespace. The latter option can be very helpful when the Python interpreter complains about unexpected indentation levels although there seems nothing amiss with your file.

If that happens you possibly have mixed tabs and spaces in way that confuse Python (as they are different as far as the interpreter is concerned) and a possible way out is to convert selected text to spaces first and then back to tabs. This way mixed spaces and tabs will be used in a uniform way again..

Copyright © crecode.com . All rights reserved.