diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 0b35a7edc..64a89ceb7 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -23,8 +23,7 @@ If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Ubuntu]
- Version [e.g. 16.04]
- - Blender version (see the splash screen on startup of Blender)
- - Blender Python version (Open the Python Console Editor screen and check the output)
+ - debugging output (run `setup.py --info`)
**Additional context**
Add any other context about the problem here.
diff --git a/.gitignore b/.gitignore
index 778c63cec..a7571c55d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
-python_dist_packages.conf
+installation.conf
*~
-.*
+.^(travis).*
*.orig
*.blend1
*.pyc
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..fcbd7bd77
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,54 @@
+# this is essential to make python work out of the box
+language: python
+
+dist: xenial
+
+# safelist
+branches:
+ only:
+ - master
+
+# Define which python version to build against.
+# As blender comes bundled with it's own python you can use just one version if you like
+python:
+ - "3.5.7"
+
+before_install:
+ # update apt-gets repository sources
+ - sudo apt-get update -qq
+
+ # install blender from official sources.
+ # This will most propably install an outdated blender version,
+ # but it will resolve all system dependencies blender has to be able to run.
+ - sudo apt-get install blender
+
+install:
+ # create temp directory where we store a recent blender version
+ - mkdir tmp && cd tmp
+
+ # download the blender version you want to test against
+ - wget http://mirror.cs.umn.edu/blender.org/release/Blender2.79/blender-2.79-linux-glibc219-x86_64.tar.bz2
+
+ # Extract the archive
+ - tar jxf blender-2.79-linux-glibc219-x86_64.tar.bz2
+
+ # rename the extracted folder to "blender" for easier reference
+ - mv blender-2.79-linux-glibc219-x86_64 blender
+
+ # remove the archive, we do not need it anymore
+ - rm blender-2.79-linux-glibc219-x86_64.tar.bz2
+
+ # go back to root directory
+ - cd ..
+
+ # now create a symlink to the addon within blenders addons directory
+ # this is important, because otherwhise blender would not be able to load the addon
+ # - sudo ln -s ${PWD}/phobos ${PWD}/tmp/blender/2.79/scripts/addons/phobos
+
+ # instead we use the setup.py to install the addon to the folder
+ - python ${PWD}/setup.py -t ${PWD}/tmp/blender/2.79/scripts/addons/phobos -b ${PWD}/tmp/blender
+ - ls ${PWD}/tmp/blender/2.79/scripts/addons/phobos
+
+# Finally start our test runner passing it the blender executable from the downloaded blender release
+script: python testrunner.py ./tmp/blender/blender
+
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 94a9ed024..000000000
--- a/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/COPYING.LESSER b/COPYING.LESSER
deleted file mode 100644
index 65c5ca88a..000000000
--- a/COPYING.LESSER
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..ec4b73ba2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,26 @@
+Copyright 2019 University of Bremen & DFKI GmbH Robotics Innovation Center
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors
+may be used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Makefile b/Makefile
index fb0787a96..f924b7aa8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,33 +1,24 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
help:
@echo 'Targets of Phobos:'
- @echo ' help - Print this help information.'
- @echo ' init - Install the Phobos requirements using pip.'
- @echo ' install - Install the Phobos code to your Blender installation.'
- @echo ' This also sets up the configuration folder for Phobos.'
+ @echo ' apidoc - Generates the Sphinx API documentation and moves'
+ @echo ' it to the gh-pages branch.'
@echo ' clean - Removes the installation configuration file for Phobos.'
@echo ' This does not remove the Phobos installation and configurations!'
@echo ' format - Formats the python code in the folder using the black code'
@echo ' formatter (github.com/ambv/black).'
- @echo ' apidoc - Generates the Sphinx API documentation and moves it to the gh-pages'
- @echo ' branch.'
+ @echo ' help - Print this help information.'
+ @echo ' init - Install the Phobos requirements using pip.'
+ @echo ' install - Install the Phobos code to your Blender installation.'
+ @echo ' This also sets up the configuration folder for Phobos.'
+ @echo ' version - Prints some help relating to drafting a new version.'
init:
pip install -r requirements.txt
@@ -36,7 +27,7 @@ install:
python3 setup.py
clean:
- rm python_dist_packages.conf
+ rm installation.conf
format:
# add docstrings and format to google style
@@ -57,4 +48,12 @@ apidoc:
mv doc/_build/html/* .
@echo 'Please commit and push the changes to publish the new doc on https://dfki-ric.github.io/phobos'
+version:
+ @echo 'Change version in:'
+ @echo ' - codemeta.json'
+ @echo ' - phobos/defs.py'
+ @echo ' - phobos/__init__.py'
+ @echo ' - doc/conf.py'
+ @echo ' - doc/index.rst'
+
.PHONY: init test install format apidoc help
diff --git a/joss/PhobosUR5.png b/PhobosUR5.png
similarity index 100%
rename from joss/PhobosUR5.png
rename to PhobosUR5.png
diff --git a/README.md b/README.md
index 229b24a16..f196aeebe 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@ black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://gith
[![license](https://img.shields.io/github/license/dfki-ric/phobos.svg?style=flat)](https://github.com/dfki-ric/phobos/blob/master/COPYING)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)
[![made-with-sphinx-doc](https://img.shields.io/badge/Made%20with-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/)
+[![Build Status](https://travis-ci.org/dfki-ric/phobos.svg?branch=master)](https://travis-ci.org/dfki-ric/phobos)
![Phobos](https://github.com/dfki-ric/phobos/wiki/img/phobos_logo_small.png)
@@ -26,8 +27,7 @@ Bremen, together with the [Robotics
Group](http://www.informatik.uni-bremen.de/robotik/index_en.php) of the
[University of Bremen](http://www.uni-bremen.de/en.html).
-Please contact [Simon V.
-Reichel](https://robotik.dfki-bremen.de/de/ueber-uns/mitarbeiter/sire01.html)
+Please contact [Kai von Szadkowski](https://robotik.dfki-bremen.de/de/ueber-uns/mitarbeiter/kavo01.html)
for any inquiries, or any questions and feedback not suited for the issues
page.
@@ -99,5 +99,4 @@ avoiding confusion or obstruction of view when editing very complex models.*
## License
-Phobos is distributed under the [GNU Lesser General Public
-License](https://www.gnu.org/licenses/lgpl.html).
+Phobos is distributed under the [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause).
diff --git a/codemeta.json b/codemeta.json
index f759dd43d..e2cc5d33b 100644
--- a/codemeta.json
+++ b/codemeta.json
@@ -9,11 +9,11 @@
"identifier": "",
"codeRepository": "https://github.com/dfki-ric/phobos",
"datePublished": "2019-02-01",
- "dateModified": "2019-02-01",
+ "dateModified": "2020-12-16",
"dateCreated": "2019-02-01",
"description": "A Blender addon to create and edit robot models in a WYSIWYG environment.",
"keywords": "robotics, Blender, Python, URDF, SDF, model",
- "license": "GNU LGPL v3.0",
+ "license": "BSD-3-Clause",
"title": "Phobos",
- "version": "v1.0.0 (Capricious Choutengan)"
+ "version": "1.0.1"
}
diff --git a/config/definitions/defaultControllers.yml b/config/definitions/defaultControllers.yml
index 8b4173da9..efd050ffa 100644
--- a/config/definitions/defaultControllers.yml
+++ b/config/definitions/defaultControllers.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
# If you want to evaluate numeric expressions in this yaml file, just enclose your expression with
diff --git a/config/definitions/defaultJoints.yml b/config/definitions/defaultJoints.yml
index a56ab8197..64bfa8f68 100644
--- a/config/definitions/defaultJoints.yml
+++ b/config/definitions/defaultJoints.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
joints:
diff --git a/config/definitions/defaultMaterials.yml b/config/definitions/defaultMaterials.yml
index 8497aa527..2bd990bf4 100644
--- a/config/definitions/defaultMaterials.yml
+++ b/config/definitions/defaultMaterials.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
materials:
diff --git a/config/definitions/defaultModel.yml b/config/definitions/defaultModel.yml
index deea47f29..afaddcb90 100644
--- a/config/definitions/defaultModel.yml
+++ b/config/definitions/defaultModel.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
model:
diff --git a/config/definitions/defaultMotors.yml b/config/definitions/defaultMotors.yml
index 4917d662f..7c8c8c5d9 100644
--- a/config/definitions/defaultMotors.yml
+++ b/config/definitions/defaultMotors.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
# If you want to evaluate numeric expressions in this yaml file, just enclose your expression with
diff --git a/config/definitions/defaultSensors.yml b/config/definitions/defaultSensors.yml
index ee5f92e9d..b930d7246 100644
--- a/config/definitions/defaultSensors.yml
+++ b/config/definitions/defaultSensors.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
#If you want to evaluate numeric expressions in this yaml file, just enclose your expression with '&'. In that simple expressions you can use the python math module.
@@ -326,6 +316,7 @@ sensors:
- internal
mars:
type: NodeCOM
+ inertianame: $selected_objects:inertial
id: $selected_objects:link
Node_velocity:
diff --git a/config/definitions/defaultSubmechanisms.yml b/config/definitions/defaultSubmechanisms.yml
index 52910c537..ea02c41b4 100644
--- a/config/definitions/defaultSubmechanisms.yml
+++ b/config/definitions/defaultSubmechanisms.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
# This file holds definitions of (sub)mechanisms commonly used in the
diff --git a/config/definitions/defaultSubmodels.yml b/config/definitions/defaultSubmodels.yml
index 91ac55f7e..280485689 100644
--- a/config/definitions/defaultSubmodels.yml
+++ b/config/definitions/defaultSubmodels.yml
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
# This file holds definitions of submodel types.
diff --git a/doc/Makefile b/doc/Makefile
index 0107c6671..a36b30584 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,5 +1,12 @@
-# Makefile for Sphinx documentation
+# -------------------------------------------------------------------------------
+# This file is part of Phobos, a Blender Add-On to edit robot models.
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
+# -------------------------------------------------------------------------------
+
+# Makefile for Sphinx documentation
# You can set these variables from the command line.
SPHINXOPTS =
diff --git a/doc/conf.py b/doc/conf.py
index 133bd128f..957a05b69 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -1,5 +1,13 @@
# -*- coding: utf-8 -*-
+
+# -------------------------------------------------------------------------------
+# This file is part of Phobos, a Blender Add-On to edit robot models.
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
+# -------------------------------------------------------------------------------
+
# Phobos documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 28 08:59:46 2018.
#
@@ -63,7 +71,7 @@
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
-release = '1.0.0 "Capricious Choutengan"'
+release = '1.0.1 "Capricious Choutengan"'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/manifest.xml b/manifest.xml
index f58925287..29cb0a739 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -1,21 +1,12 @@
-
+
@@ -27,7 +18,7 @@
Kai/kai_alexander.von_szadkowski@dfki.de, Simon/simon.reichel@dfki.de
Simon/simon.reichel@dfki.de
- LPGL 3
+ BSD-3-Clause
https://robotik.dfki-bremen.de/en/research/softwaretools/phobos.html
https://github.com/dfki-ric/phobos/wiki/img/phobos_logo_small.png
diff --git a/joss/paper.bib b/paper.bib
similarity index 90%
rename from joss/paper.bib
rename to paper.bib
index d1a0d19cc..1e8b3a790 100644
--- a/joss/paper.bib
+++ b/paper.bib
@@ -7,7 +7,7 @@ @inproceedings{hyrodyn
}
@misc{phobosrepo,
- title = {Phobos Github Repository},
+ title = {{Phobos GitHub Repository}},
year = {2019},
howpublished = {\url{https://github.com/dfki-ric/phobos}}
}
diff --git a/joss/phobos_joss.md b/paper.md
similarity index 98%
rename from joss/phobos_joss.md
rename to paper.md
index 04316f354..1a3f98eb9 100644
--- a/joss/phobos_joss.md
+++ b/paper.md
@@ -39,7 +39,7 @@ consuming, challenging task for the modeler. Also, tiny mistakes in the model
description can lead to huge differences in the modeled system. With increasing
model complexity the model files become even more difficult to debug.
-![[Universal Robots UR5](https://www.universal-robots.com/products/ur5-robot/) within ``Phobos``](PhobosUR5.png)
+![Universal Robots UR5 (https://www.universal-robots.com/products/ur5-robot/) within ``Phobos``](PhobosUR5.png)
``Phobos`` is an add-on for the open-source 3D modeling software
[Blender](https://www.blender.org/) that allows users to edit models of robots
diff --git a/phobos/__init__.py b/phobos/__init__.py
index 7496bdf49..2fa2c5ce8 100644
--- a/phobos/__init__.py
+++ b/phobos/__init__.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python3.5
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
@@ -33,7 +23,7 @@
# TODO double import of basemodule?
import bpy
import phobos
-
+import yaml
def import_submodules(package, recursive=True, verbose=False):
"""Import all submodules of a module, recursively, including subpackages.
@@ -81,8 +71,8 @@ def import_submodules(package, recursive=True, verbose=False):
"name": "Phobos",
"description": "A toolbox to enable editing of robot models in Blender.",
"author": "Kai von Szadkowski, Ole Schwiegert, Stefan Rahms, Malte Langosz, Simon Reichel",
- "version": (0, 7, 1),
- "blender": (2, 69, 0),
+ "version": (1, 0, 1),
+ "blender": (2, 79, 0),
"location": "Phobos adds a number of custom tool panels.",
"warning": "",
"wiki_url": "https://github.com/dfki-ric/phobos/wiki",
@@ -92,18 +82,16 @@ def import_submodules(package, recursive=True, verbose=False):
}
# TODO rework yaml import: loading module twice if yaml is not found...
-yamlconfpath = os.path.dirname(__file__) + "/python_dist_packages.conf"
-if os.path.isfile(yamlconfpath):
- f = open(yamlconfpath)
- distpath = f.read().replace('\n', '')
- f.close()
- sys.path.insert(0, os.path.normpath(distpath))
- import yaml
-
- # OPT here we could add additional required imports
-# stop execution, when yaml cannot be imported
+installconfpath = os.path.dirname(__file__) + "/installation.conf"
+if os.path.isfile(installconfpath):
+ with open(installconfpath, 'r') as conffile:
+ python_package_path = conffile.readline().split(' #')[0]
+ python_executable = conffile.readline().split(' #')[0]
+ blender_executable = conffile.readline().split(' #')[0]
+ python_version = conffile.readline().split(' #')[0]
+ blender_version = conffile.readline().split(' #')[0]
else:
- raise FileNotFoundError('No python_dist_packages.conf file found. Please reinstall phobos.')
+ raise FileNotFoundError('No .conf file found. Please reinstall phobos.')
# Add custom YAML (de-)serializer
diff --git a/phobos/defs.py b/phobos/defs.py
index c40926c89..08d23b549 100644
--- a/phobos/defs.py
+++ b/phobos/defs.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
@@ -32,7 +22,7 @@
import phobos.phobossystem as phobossystem
# Phobos information
-version = '0.7'
+version = '1.0.1 "Capricious Choutengan"'
repository = 'https://github.com/dfki-ric/phobos'
# definitions of which elements are assigned to which default layers
diff --git a/phobos/display.py b/phobos/display.py
index 4dc6d760f..e5761dc45 100644
--- a/phobos/display.py
+++ b/phobos/display.py
@@ -1,21 +1,11 @@
-# TODO SHEBANG
+#!/usr/bin/python
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import collections
diff --git a/phobos/io/__init__.py b/phobos/io/__init__.py
index b237755e4..34d0d55f8 100644
--- a/phobos/io/__init__.py
+++ b/phobos/io/__init__.py
@@ -1,21 +1,12 @@
-# TODO shebang
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""Contains all kind of input/output modules which are required to import/export different formats.
diff --git a/phobos/io/entities/__init__.py b/phobos/io/entities/__init__.py
index 3edd3eeb7..4dafeda7a 100644
--- a/phobos/io/entities/__init__.py
+++ b/phobos/io/entities/__init__.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python3.5
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/entities/entities.py b/phobos/io/entities/entities.py
index 8e72f54a7..acd8b41fc 100644
--- a/phobos/io/entities/entities.py
+++ b/phobos/io/entities/entities.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/phobos/io/entities/heightmap.py b/phobos/io/entities/heightmap.py
index ea9bd65eb..28ec4a863 100644
--- a/phobos/io/entities/heightmap.py
+++ b/phobos/io/entities/heightmap.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/entities/light.py b/phobos/io/entities/light.py
index a43a26893..5775765c9 100644
--- a/phobos/io/entities/light.py
+++ b/phobos/io/entities/light.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/entities/primitive.py b/phobos/io/entities/primitive.py
index deb62e264..010b23e15 100644
--- a/phobos/io/entities/primitive.py
+++ b/phobos/io/entities/primitive.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/entities/sdf.py b/phobos/io/entities/sdf.py
index bbf04448f..969d7b5ae 100644
--- a/phobos/io/entities/sdf.py
+++ b/phobos/io/entities/sdf.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import os
diff --git a/phobos/io/entities/smurf.py b/phobos/io/entities/smurf.py
index f200cc87b..8986d86e7 100644
--- a/phobos/io/entities/smurf.py
+++ b/phobos/io/entities/smurf.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import os
diff --git a/phobos/io/entities/srdf.py b/phobos/io/entities/srdf.py
index a654180b1..5d4149620 100644
--- a/phobos/io/entities/srdf.py
+++ b/phobos/io/entities/srdf.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/entities/submechanisms.py b/phobos/io/entities/submechanisms.py
index 7befbdfd9..8cb3cb4bc 100644
--- a/phobos/io/entities/submechanisms.py
+++ b/phobos/io/entities/submechanisms.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
from phobos.phoboslog import log
diff --git a/phobos/io/entities/thumbnail.py b/phobos/io/entities/thumbnail.py
index 81597a888..f50cbf0de 100644
--- a/phobos/io/entities/thumbnail.py
+++ b/phobos/io/entities/thumbnail.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/phobos/io/entities/urdf.py b/phobos/io/entities/urdf.py
index 9f1f68eb5..f882fdbdc 100644
--- a/phobos/io/entities/urdf.py
+++ b/phobos/io/entities/urdf.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
from os import path
diff --git a/phobos/io/entities/yaml.py b/phobos/io/entities/yaml.py
index c00e2ffa4..283d4e47a 100644
--- a/phobos/io/entities/yaml.py
+++ b/phobos/io/entities/yaml.py
@@ -1,21 +1,12 @@
-# TODO add shebang and intro documentation
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import yaml
diff --git a/phobos/io/libraries/__init__.py b/phobos/io/libraries/__init__.py
index 78b668cf7..93197630a 100644
--- a/phobos/io/libraries/__init__.py
+++ b/phobos/io/libraries/__init__.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python3.5
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/libraries/mechanisms.py b/phobos/io/libraries/mechanisms.py
index 70c2716d6..9989097d0 100644
--- a/phobos/io/libraries/mechanisms.py
+++ b/phobos/io/libraries/mechanisms.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
@@ -61,7 +51,13 @@ def compileMechanismList():
log("Compiling mechanism list from local library...", "INFO")
- imagefolderpath = os.path.join(bUtils.getPhobosConfigPath(), 'images', 'mechanisms')
+ try:
+ phobosconfig = bUtils.getPhobosConfigPath()
+ except KeyError:
+ log('Can not create mechanism preview. Phobos not registered.', 'DEBUG')
+ return
+
+ imagefolderpath = os.path.join(phobosconfig, 'images', 'mechanisms')
if imagefolderpath == '' or not os.path.exists(imagefolderpath):
log('Visual mechanism representations could not be found.')
return
diff --git a/phobos/io/libraries/models.py b/phobos/io/libraries/models.py
index eca6aaf3a..8d1dbcef2 100644
--- a/phobos/io/libraries/models.py
+++ b/phobos/io/libraries/models.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import os
@@ -86,7 +76,12 @@ def compileModelList():
model_previews.clear()
model_data.clear()
- rootpath = bUtils.getPhobosPreferences().modelsfolder
+ try:
+ rootpath = bUtils.getPhobosPreferences().modelsfolder
+ except KeyError:
+ log('Can not create mechanism preview. Phobos not registered.', 'DEBUG')
+ return
+
if rootpath == '' or not os.path.exists(rootpath):
log('Model library folder does not exist.')
return
diff --git a/phobos/io/meshes/__init__.py b/phobos/io/meshes/__init__.py
index e59452965..20f833650 100644
--- a/phobos/io/meshes/__init__.py
+++ b/phobos/io/meshes/__init__.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python3.5
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/meshes/meshes.py b/phobos/io/meshes/meshes.py
index 5dbc3300b..6dec0c160 100644
--- a/phobos/io/meshes/meshes.py
+++ b/phobos/io/meshes/meshes.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/scenes/__init__.py b/phobos/io/scenes/__init__.py
index 9f6668744..4bc46085f 100644
--- a/phobos/io/scenes/__init__.py
+++ b/phobos/io/scenes/__init__.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python3.5
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/io/scenes/mars.py b/phobos/io/scenes/mars.py
index 47d568e2e..282c846cb 100644
--- a/phobos/io/scenes/mars.py
+++ b/phobos/io/scenes/mars.py
@@ -1,24 +1,14 @@
-# TODO this is not used? remove it or make an idea pool somewhere...
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
-
# def round_float(float_as_str, decimal=6):
# """Casts 'float_as_str' to float and round to 'decimal' decimal places. The possible exception
# **ValueError** is not handled in the function itself!
diff --git a/phobos/io/scenes/sdfworld.py b/phobos/io/scenes/sdfworld.py
index 0c6f89c2a..fba03d335 100644
--- a/phobos/io/scenes/sdfworld.py
+++ b/phobos/io/scenes/sdfworld.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import yaml
diff --git a/phobos/io/scenes/smurfs.py b/phobos/io/scenes/smurfs.py
index 7c71d5497..eca9d62a9 100644
--- a/phobos/io/scenes/smurfs.py
+++ b/phobos/io/scenes/smurfs.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import yaml
diff --git a/phobos/model/__init__.py b/phobos/model/__init__.py
index 7a09e458a..2d76e21dc 100644
--- a/phobos/model/__init__.py
+++ b/phobos/model/__init__.py
@@ -1,19 +1,11 @@
-# TODO SHEBANG
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
+
diff --git a/phobos/model/controllers.py b/phobos/model/controllers.py
index 65ad9b58e..35cee7e1e 100644
--- a/phobos/model/controllers.py
+++ b/phobos/model/controllers.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/phobos/model/geometries.py b/phobos/model/geometries.py
index 2262551d3..2551725f1 100644
--- a/phobos/model/geometries.py
+++ b/phobos/model/geometries.py
@@ -1,21 +1,12 @@
-# TODO add shebang and document introduction
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import os
diff --git a/phobos/model/inertia.py b/phobos/model/inertia.py
index 2634877b7..f896a9a87 100644
--- a/phobos/model/inertia.py
+++ b/phobos/model/inertia.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
@@ -530,6 +520,10 @@ def fuse_inertia_data(inertials):
"""
+ from phobos.utils.io import getExpSettings
+
+ expsetting = 10**(-getExpSettings().decimalPlaces)
+
# Find objects who have some inertial data
for obj in inertials:
if not any([True for key in obj.keys() if key.startswith('inertial/')]):
@@ -537,7 +531,7 @@ def fuse_inertia_data(inertials):
# Check for an empty list -> No inertials to fuse
if not inertials:
- return None, None, None
+ return 1e-3, [0.0, 0.0, 0.0], numpy.diag([1e-3, 1e-3, 1e-3])
fused_inertia = numpy.zeros((3, 3))
fused_com = numpy.zeros((1, 3))
@@ -547,9 +541,9 @@ def fuse_inertia_data(inertials):
fused_mass, fused_com = combine_com_3x3(inertials)
# Check for conformity
- if fused_mass <= 0.0:
+ if fused_mass <= expsetting:
log(" Correcting fused mass : negative semidefinite value.", 'WARNING')
- fused_mass = 1e-3 if fused_mass < 1e-3 else fused_mass
+ fused_mass = expsetting if fused_mass < expsetting else fused_mass
# TODO Maybe we can reuse the functions defined here.
# Calculate the fused inertias
@@ -572,19 +566,19 @@ def fuse_inertia_data(inertials):
fused_inertia += numpy.dot(numpy.dot(current_Rotation.T, current_Inertia), current_Rotation)
# Check the inertia
- if any(element <= 1e-3 for element in fused_inertia.diagonal()):
+ if any(element <= expsetting for element in fused_inertia.diagonal()):
log(" Correting fused inertia : negative semidefinite diagonal entries.", 'WARNING')
for i in range(3):
- fused_inertia[i, i] = 1e-3 if fused_inertia[i, i] <= 1e-3 else fused_inertia[i, i]
+ fused_inertia[i, i] = expsetting if fused_inertia[i, i] <= expsetting else fused_inertia[i, i]
- if any(element <= 1e-3 for element in numpy.linalg.eigvals(fused_inertia)):
+ if any(element <= expsetting for element in numpy.linalg.eigvals(fused_inertia)):
log(" Correcting fused inertia : negative semidefinite eigenvalues", 'WARNING')
S, V = numpy.linalg.eig(fused_inertia)
- S[S <= 0.0] = 1e-3
+ S[S <= expsetting] = expsetting
fused_inertia = V.dot(numpy.diag(S).dot(V.T))
# Add minimum value for the inertia
for i in range(3):
- fused_inertia[i, i] = 1e-3 if fused_inertia[i, i] <= 1e-3 else fused_inertia[i, i]
+ fused_inertia[i, i] += expsetting if fused_inertia[i, i] <= expsetting else fused_inertia[i, i]
return fused_mass, fused_com, fused_inertia
diff --git a/phobos/model/joints.py b/phobos/model/joints.py
index d39d8123c..b6eea0f32 100644
--- a/phobos/model/joints.py
+++ b/phobos/model/joints.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/model/lights.py b/phobos/model/lights.py
index d9de0fb7c..105ba1e36 100644
--- a/phobos/model/lights.py
+++ b/phobos/model/lights.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/phobos/model/links.py b/phobos/model/links.py
index 19d7eff4f..d5350183a 100644
--- a/phobos/model/links.py
+++ b/phobos/model/links.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/model/materials.py b/phobos/model/materials.py
index a9a12d98c..c4cbda395 100644
--- a/phobos/model/materials.py
+++ b/phobos/model/materials.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/model/models.py b/phobos/model/models.py
index 4b0616364..63e046c3d 100644
--- a/phobos/model/models.py
+++ b/phobos/model/models.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import os
diff --git a/phobos/model/motors.py b/phobos/model/motors.py
index 3aa351c49..ec3dfb152 100644
--- a/phobos/model/motors.py
+++ b/phobos/model/motors.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
@@ -146,6 +136,18 @@ def deriveMotor(obj, jointdict=None):
props['joint'] = nUtils.getObjectName(obj.parent, phobostype='joint')
+ # check for a mimic motor
+ for k in (obj.parent).keys():
+ # Check for mimic motor
+ if "mimic" in k:
+ # Find the name
+ mimic_driver = sUtils.getObjectByName((obj.parent)['joint/mimic_joint'], phobostypes = ['link'])
+ c_motor = sUtils.getImmediateChildren(mimic_driver, phobostypes = ['motor'])
+ props['mimic_motor'] = nUtils.getObjectName(c_motor[0], phobostype = 'motor')
+ props['mimic_multiplier'] = (obj.parent)['joint/mimic_multiplier']
+ props['mimic_offset'] = (obj.parent)['joint/mimic_offset']
+ break
+
# try to derive the motor controller
controllerobjs = [control for control in obj.children if control.phobostype == 'controller']
if controllerobjs:
diff --git a/phobos/model/poses.py b/phobos/model/poses.py
index 1dc1eda26..890ba6a1d 100644
--- a/phobos/model/poses.py
+++ b/phobos/model/poses.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/model/sensors.py b/phobos/model/sensors.py
index 34c7ed70f..09a842f7d 100644
--- a/phobos/model/sensors.py
+++ b/phobos/model/sensors.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/phobos/operators/__init__.py b/phobos/operators/__init__.py
index e56460413..a416e139c 100644
--- a/phobos/operators/__init__.py
+++ b/phobos/operators/__init__.py
@@ -1,20 +1,10 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
diff --git a/phobos/operators/editing.py b/phobos/operators/editing.py
index d43bad523..ea7ec1a7b 100644
--- a/phobos/operators/editing.py
+++ b/phobos/operators/editing.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/operators/generic.py b/phobos/operators/generic.py
index daf4e5356..a02b0e290 100644
--- a/phobos/operators/generic.py
+++ b/phobos/operators/generic.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/operators/io.py b/phobos/operators/io.py
index 44aae2c07..83acad92e 100644
--- a/phobos/operators/io.py
+++ b/phobos/operators/io.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/operators/naming.py b/phobos/operators/naming.py
index 00e35795c..771ee7b02 100644
--- a/phobos/operators/naming.py
+++ b/phobos/operators/naming.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/operators/poses.py b/phobos/operators/poses.py
index 3d948a285..20420d87f 100644
--- a/phobos/operators/poses.py
+++ b/phobos/operators/poses.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/operators/selection.py b/phobos/operators/selection.py
index a950c75fe..fee384ffb 100644
--- a/phobos/operators/selection.py
+++ b/phobos/operators/selection.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/phobosgui.py b/phobos/phobosgui.py
index 75ce70731..6cd3e3e80 100644
--- a/phobos/phobosgui.py
+++ b/phobos/phobosgui.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import sys
@@ -153,7 +143,7 @@ def draw(self, context):
box = layout.box()
row = box.row()
row.label(text="Logging")
- box.prop(self, "logfile", text="log file path")
+ box.prop(self, "logfile", text="log file")
box.prop(self, "logtofile", text="write to logfile")
box.prop(self, "logtoterminal", text="write to terminal")
box.prop(self, "loglevel", text="log level")
diff --git a/phobos/phoboslog.py b/phobos/phoboslog.py
index 2d5aa7364..d0b404ea5 100644
--- a/phobos/phoboslog.py
+++ b/phobos/phoboslog.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import inspect
@@ -74,7 +64,7 @@ def decorate(level):
return level
-def log(message, level="INFO", prefix="", guionly=False, end='\n'):
+def log(message, level="INFO", prefix="", guionly=False, logfile=True, end='\n'):
"""Logs a given message to the blender console/logging file and if log level is low enough.
The origin can be defined as string or an object. The message is logged by the operator
@@ -85,6 +75,7 @@ def log(message, level="INFO", prefix="", guionly=False, end='\n'):
level(str, optional): valid log level for the message as defined by :data:`.LOGLEVELS` (Default value = "INFO")
prefix(str, optional): any string that should be printed before the message (Default value = "")
guionly(bool, optional): if True, only prints to GUI (Default value = False)
+ logfile(bool, optional): if False, suppress message in logfile (Default value = True)
end(str, optional): string to be used at the end of the resulting print statement (Default value = '\\n')
Returns:
@@ -124,14 +115,14 @@ def log(message, level="INFO", prefix="", guionly=False, end='\n'):
terminalmsg = Col.OKBLUE.value + message + Col.ENDC.value
# log to file if activated
- if prefs.logtofile and not guionly:
+ if prefs.logtofile and logfile and not guionly:
try:
with open(prefs.logfile, "a") as logfile:
logfile.write(msg + end)
except (FileNotFoundError, IsADirectoryError):
- log("Invalid log file path, cannot write to log file!", 'ERROR', guionly=True)
+ log("Invalid log file path, cannot write to log file!", 'ERROR', logfile=False)
except (IOError, OSError):
- log("Cannot write to log file!", 'ERROR', guionly=True)
+ log("Cannot write to log file!", 'ERROR', logfile=False)
# log to terminal or Blender
if prefs.logtoterminal and not guionly:
diff --git a/phobos/phobossystem.py b/phobos/phobossystem.py
index 00c611872..5dc08f187 100644
--- a/phobos/phobossystem.py
+++ b/phobos/phobossystem.py
@@ -1,21 +1,12 @@
-# TODO SHEBANG
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import sys
diff --git a/phobos/utils/__init__.py b/phobos/utils/__init__.py
index e56460413..a416e139c 100644
--- a/phobos/utils/__init__.py
+++ b/phobos/utils/__init__.py
@@ -1,20 +1,10 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
diff --git a/phobos/utils/blender.py b/phobos/utils/blender.py
index f3aa178d3..78e9da156 100644
--- a/phobos/utils/blender.py
+++ b/phobos/utils/blender.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/utils/editing.py b/phobos/utils/editing.py
index fb7b4cdbc..24351eef4 100644
--- a/phobos/utils/editing.py
+++ b/phobos/utils/editing.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/utils/general.py b/phobos/utils/general.py
index ba0429555..01d6855a1 100644
--- a/phobos/utils/general.py
+++ b/phobos/utils/general.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/utils/git.py b/phobos/utils/git.py
index 4ba26ba97..e2d75213d 100644
--- a/phobos/utils/git.py
+++ b/phobos/utils/git.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import subprocess
diff --git a/phobos/utils/io.py b/phobos/utils/io.py
index 6f9540312..b9ff8b2ee 100644
--- a/phobos/utils/io.py
+++ b/phobos/utils/io.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import shutil
@@ -63,20 +53,20 @@ def xmlline(ind, tag, names, values):
return ''.join(line)
-def l2str(items, start=0, end=-1):
+def l2str(items, start=0, end=None):
"""Generates string from (part of) a list.
Args:
items(list): List from which the string is derived (elements need to implement str())
start(int, optional): Inclusive start index for iteration (Default value = 0)
- end(int, optional): Exclusive end index for iteration (Default value = -1)
+ end(int, optional): Exclusive end index for iteration (Default value = None)
Returns:
: str - Generated string.
"""
start = max(start, 0)
- end = end if end >= 0 else len(items)
+ end = end if end else len(items)
return ' '.join([str(i) for i in items[start:end]])
diff --git a/phobos/utils/naming.py b/phobos/utils/naming.py
index 297f94cb4..56054e5e8 100644
--- a/phobos/utils/naming.py
+++ b/phobos/utils/naming.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
@@ -118,15 +108,16 @@ def getObjectName(obj, phobostype=None):
def isValidModelname(name):
- """Returns if a name contains characters other than alphanumeric, '_' and '-'
+ """Returns if a name contains characters other than alphanumeric, '_' and '-'.
+ Also, empyt strings are not valid model names.
Args:
- name:
+ name (str): potential name for a model
Returns:
-
+ bool -- True if the name is a valid model name according to convention, False if not.
"""
- return not re.search(r'[^A-Za-z0-9_\-\\]', name)
+ return not re.search(r'[^A-Za-z0-9_\-\\]', name) and len(name) > 0
def getModelName(obj):
diff --git a/phobos/utils/selection.py b/phobos/utils/selection.py
index f1fcb9fa2..95e2bcbc9 100644
--- a/phobos/utils/selection.py
+++ b/phobos/utils/selection.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
diff --git a/phobos/utils/validation.py b/phobos/utils/validation.py
index 1159c43b9..665b2aa60 100644
--- a/phobos/utils/validation.py
+++ b/phobos/utils/validation.py
@@ -1,22 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
from copy import deepcopy as dc
@@ -640,6 +630,8 @@ def validateInertiaData(obj, *args, adjust=False):
errors = []
+ expsetting = 10**(-getExpSettings().decimalPlaces)
+
# check dictionary parameters (most of the time pre object creation)
if isinstance(obj, dict):
missing = []
@@ -703,7 +695,7 @@ def validateInertiaData(obj, *args, adjust=False):
inertia = numpy.around(
numpy.array(inertiaListToMatrix(inertia)), decimals=getExpSettings().decimalPlaces
)
- if any(element <= 0.0 for element in inertia.diagonal()):
+ if any(element <= expsetting for element in inertia.diagonal()):
errors.append(
ValidateMessage(
"Negative semidefinite main diagonal in inertia data!",
@@ -715,7 +707,7 @@ def validateInertiaData(obj, *args, adjust=False):
)
# Calculate the determinant if consistent, quick check
- if numpy.linalg.det(inertia) <= 0.0:
+ if numpy.linalg.det(inertia) <= expsetting:
errors.append(
ValidateMessage(
"Negative semidefinite determinant in inertia data! Checking singular values.",
@@ -727,10 +719,10 @@ def validateInertiaData(obj, *args, adjust=False):
)
# Calculate the eigenvalues if not consistent
- if any(element <= 0.0 for element in numpy.linalg.eigvals(inertia)):
+ if any(element <= expsetting for element in numpy.linalg.eigvals(inertia)):
# Apply singular value decomposition and correct the values
S, V = numpy.linalg.eig(inertia)
- S[S <= 0.0] = 1e-3
+ S[S <= expsetting] = expsetting
inertia = V.dot(numpy.diag(S).dot(V.T))
errors.append(
ValidateMessage(
@@ -752,7 +744,7 @@ def validateInertiaData(obj, *args, adjust=False):
{} if not adjust else {'log_info': "Adjusted to 1e-3."},
)
)
- mass = 1e-3
+ mass = expsetting
inertia = inertiaMatrixToList(inertia)
diff --git a/requirements.txt b/requirements.txt
index 50e6f00e5..c82997ec2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,19 +1,9 @@
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
# The following python packages need to be installed
diff --git a/setup.py b/setup.py
old mode 100644
new mode 100755
index 9714554f6..33bcfea09
--- a/setup.py
+++ b/setup.py
@@ -1,21 +1,11 @@
-#!/usr/bin/env python3.5
+#!/usr/bin/python
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
"""
@@ -29,34 +19,21 @@
import os
import os.path as path
+import glob
import sys
import shutil
+import argparse
from distutils.dir_util import copy_tree
-import importlib.util
-
-scriptinformation = """
-This is the setup script for Phobos.
-
-By default, it installs the Blender AddOn Phobos to the Blender configuration folder.
-At the same time, the default configurations are copied to the user Phobos configuration
-folder.
-
-Parameters:
-
- --help: Show this message and exit.
-
- --startup-preset: Copies the default Phobos Blender startup file to the Blender
- configuration folder (replacing the existing startup file).
-"""
+from importlib import util
# make installation originate from the path of this setup file
-phoboshome = os.path.dirname(os.path.abspath(__file__))
+phoboshome = path.dirname(path.abspath(__file__))
# load the phobossystem as module from file
-module_spec = importlib.util.spec_from_file_location(
+module_spec = util.spec_from_file_location(
'phobossystem', path.join(phoboshome, 'phobos/phobossystem.py')
)
-phobossystem = importlib.util.module_from_spec(module_spec)
+phobossystem = util.module_from_spec(module_spec)
module_spec.loader.exec_module(phobossystem)
addonpath = path.join(phobossystem.getScriptsPath(), 'addons', 'phobos')
blenderconfigpath = phobossystem.getBlenderConfigPath()
@@ -76,47 +53,136 @@ def updateFolderContents(src, dst):
if __name__ == '__main__':
- # check whether the right python version is used
- pyver = sys.version_info
- print(
- 'You started this script with python version: {}.{}'.format(
- str(pyver.major), str(pyver.minor)
- )
- )
- print('Make sure Blender uses the same version!')
-
- if '--help' in sys.argv:
- print(scriptinformation)
+
+ parser = argparse.ArgumentParser(description='''
+ This is the setup script for Phobos.
+
+ By default, it installs the Blender AddOn Phobos to the Blender configuration folder.
+ At the same time, the default configurations are copied to the user Phobos configuration
+ folder.''')
+ parser.add_argument('-p', '--startup-preset', dest='startup_preset',
+ action='store_true', default=False,
+ help='''Copies the default Phobos Blender startup file to the Blender
+ 'configuration folder (replacing the existing startup file).''')
+ parser.add_argument('-t', '--install-to', dest='install_to', metavar='DIR', default=None,
+ help='install addon to the specified directory')
+ parser.add_argument('-b', '--blender', metavar='DIR', dest='blender_path',
+ default=None, help='use the specified Blender folder (instead of asking)')
+ parser.add_argument('-i', '--info', dest='print_info', action='store_true',
+ default=False, help='print debugging info (such as blender version etc.)')
+
+ globals().update(vars(parser.parse_args()))
+
+ # look for existing installation configuration
+ if path.isfile(path.join(phoboshome, 'installation.conf')):
+ print('installation.conf found! Configuration done.')
+ with open(path.join(phoboshome, 'installation.conf'), 'r') as conffile:
+ python_package_path = conffile.readline().split(' #')[0]
+ if not blender_path:
+ blender_path = conffile.readline().split(' #')[0]
+ else:
+ conffile.readline()
+ python_executable = conffile.readline().split(' #')[0]
+ blender_executable = conffile.readline().split(' #')[0]
+ python_version = conffile.readline().split(' #')[0]
+ blender_version = conffile.readline().split(' #')[0]
+ # check for existing YAML installation
+ else:
+ if not blender_path:
+ blender_path = path.expanduser(input('Where is Blender installed to? '))
+ blender_version = glob.glob(path.join(blender_path, '[0-9].[0-9][0-9]'))
+ if not blender_version or not path.isdir(blender_version[0]):
+ print("Could not identify the blender subfolder.")
+ print("Installation aborted!")
+ sys.exit(1)
+ blender_version = path.basename(blender_version[0])
+ blender_executable = path.join(blender_path, 'blender')
+ if not path.isfile(blender_executable):
+ print("Could not find Blender executable.\nInstallation aborted.")
+ sys.exit(1)
+
+ bpython_files = glob.glob(path.join(
+ blender_path, blender_version, 'python', 'bin', 'py*'))
+ if not bpython_files:
+ print("Could not find python executable in blender installation.")
+ print("Installation aborted!")
+ sys.exit(1)
+ python_executable = bpython_files[0]
+ python_version = path.basename(python_executable).strip('m').strip('python')
+ python_package_path = path.normpath((path.join(
+ blender_path, blender_version, 'python', 'lib', 'python' + python_version,
+ 'site-packages')))
+
+ print('Installing PIP...')
+ os.system(python_executable + ' -m ensurepip')
+ os.system(python_executable + ' -m pip install --upgrade pip')
+ print("... successful.\n")
+
+ print('Installing YAML...')
+ os.system(python_executable + ' -m pip install PyYaml')
+ os.system(python_executable + ' -m pip install --upgrade PyYaml')
+ print("... successful.\n")
+
+ # write python dist packages path into config file
+ with open(path.join(phoboshome, 'installation.conf'), 'w') as distconffile:
+ distconffile.truncate()
+ distconffile.write(python_package_path + ' # Python package installation path\n')
+ distconffile.write(blender_path + ' # Blender installation path\n')
+ distconffile.write(python_executable + ' # python executable\n')
+ distconffile.write(blender_executable + ' # Blender executable\n')
+ distconffile.write(python_version + ' # Python version\n')
+ distconffile.write(blender_version + ' # Blender version\n')
+
+ if print_info:
+ print('''
+Debug information for Phobos:
+ - Blender version {} (installed in {})
+ - Python version {} (located in {})
+ - Python site packages are in {}:
+ - {}
+ '''.format(blender_version, blender_path, python_version,
+ python_executable, python_package_path,
+ '\n - '.join(package for package in os.listdir(python_package_path))))
sys.exit(0)
+ if install_to:
+ addonpath = install_to
+
# install addon
- if os.path.exists(addonpath):
+ if path.exists(addonpath):
shutil.rmtree(addonpath) # always clean install folder
- copied_files = updateFolderContents(os.path.join(phoboshome, 'phobos'), addonpath)
+ print('Removed older installation.')
+
+ copied_files = updateFolderContents(path.join(phoboshome, 'phobos'), addonpath)
if not copied_files:
- print(
- 'Something went wrong with copying the addon files to your Blender installation.\n',
- 'Aborting installation.',
- )
- sys.exit(0)
+ print('Something went wrong with copying the addon files to your Blender installation.\n',
+ 'Aborting installation.')
+ sys.exit(1)
+ else:
+ print('Copied addon files to ' + addonpath + '.')
+
+ shutil.copy2(path.join(phoboshome, 'installation.conf'),
+ path.join(addonpath, 'installation.conf'))
- # install startup blend
- if '--startup-preset' in sys.argv:
- shutil.copy(os.path.join(phoboshome, 'config', 'startup.blend'), blenderconfigpath)
+ # install optional startup blend
+ if startup_preset:
+ shutil.copy(path.join(phoboshome, 'config', 'startup.blend'), blenderconfigpath)
# install config files
copied_files = updateFolderContents(
- os.path.join(phoboshome, 'config'), phobossystem.getConfigPath()
- )
+ path.join(phoboshome, 'config'), phobossystem.getConfigPath())
if not copied_files:
print('Something went wrong with copying config files.')
- os.remove(os.path.join(phobossystem.getConfigPath(), 'startup.blend'))
+ os.remove(path.join(phobossystem.getConfigPath(), 'startup.blend'))
# install templates
templatespath = path.join(phobossystem.getScriptsPath(), 'templates_py')
copied_files = updateFolderContents(path.join(phoboshome, 'templates_py'), templatespath)
if not copied_files:
- print('Something went wrong with copying operator presets.')
+ print('Something went wrong with copying operator presets.\nInstallation aborted.')
+ sys.exit(1)
+
+ print('Installation successful!')
# # install presets
# presetspath = path.join(phobossystem.getScriptsPath(), 'presets', 'operator')
@@ -124,77 +190,18 @@ def updateFolderContents(src, dst):
# if not copied_files:
# print('Something went wrong with copying operator presets.')
- # look for existing yamlpath configuration
- if path.isfile(path.join(phoboshome, 'python_dist_packages.conf')):
- print('python_dist_packages.conf found! Configuration done.')
- # check for existing YAML installation
- else:
- try:
- import yaml
- except ImportError:
- print(
- 'YAML installation not found. Please install it first:'
- + '\n\n'
- + ' pip3 install PyYaml\n\n'
- )
- print(
- 'Please make sure you followed the instructions on '
- + 'https://github.com/dfki-ric/phobos/wiki/Installation'
- )
- print('YAML configuration aborted. Installation incomplete.')
- sys.exit(0)
- # OPT here we could add additional requirement checks
-
- import site
-
- # write python dist packages path into config file
- with open(path.join(phoboshome, 'python_dist_packages.conf'), 'w') as distconffile:
- distconffile.truncate()
- distpath = site.getsitepackages()[0]
- distconffile.write(path.normpath(distpath))
-
- shutil.copy2(
- path.join(phoboshome, 'python_dist_packages.conf'),
- os.path.join(addonpath, 'python_dist_packages.conf'),
- )
-
-
"""
Thoughts on importing external packages:
- Blender brings its own python
- The system python version cannot be assumed to be the same as the internal in blender
- thus linking to the systems site package version only works for the coincidence of equal versions
-Possible solutions:
- a) install packages of same python version as blender's internal to internal site packages
- b) setup virtual environment somewhere in the system and add to blender python's path environment
+Possible other solutions:
+ a) setup virtual environment somewhere in the system and add to blender python's path environment
Solutions in detail:
-a) Install into blender python
-
- This is generally possible by executing:
- python3.5 -m pip install --target /path/to/blender packagename
- example:
- python3.5 -m pip install --target =/home/dfki.uni-bremen.de/kavonszadkowski/tools/blender-2.79/2.79/python/lib/python3.5/site-packages packagename
-
- The /path/to/blender can be retrieved from within blender by executing:
- import site
- sitepackagepath = site.getsitepackages()[0]
-
- This could be retrieved to this script by calling blender as follows:
- blender -b -P script.py
-
- with script.py writing out the sitepackagepath and closing blender.
- For this, however, the appropriate binary for blender is required, which would already suffice
- to derive the path.
-
- Another alternative would thus be to try importing external packages upon phobos startup, and
- run a shell command to install missing packages of the correct version to blender's
- then-known-location by using
- --target.
-
-b) This script could set up a virtual environment with the correct python version and install all
+a) This script could set up a virtual environment with the correct python version and install all
packages, then place a file containing the path of that environment to phobos, which would expand
the path upon startup. In fact, the install file itself could set up the environment, asking the
user where to put it. Alternatively and more simply, the environment could be created where the
diff --git a/templates_py/phobos_convert_motor_pre_1_0.py b/templates_py/phobos_convert_motor_pre_1_0.py
index 1d72911b1..bc34d76c0 100644
--- a/templates_py/phobos_convert_motor_pre_1_0.py
+++ b/templates_py/phobos_convert_motor_pre_1_0.py
@@ -1,3 +1,14 @@
+#!/usr/bin/python3
+# coding=utf-8
+
+# -------------------------------------------------------------------------------
+# This file is part of Phobos, a Blender Add-On to edit robot models.
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
+# -------------------------------------------------------------------------------
+
import bpy
from phobos.utils.selection import selectObjects, getImmediateChildren
@@ -22,8 +33,11 @@ def derive_oldMotor(obj):
if oldProps in obj.keys():
if oldProps == 'motor/type' and obj[oldProps] == 'PID':
new_motor.update({newProps: 'generic_bldc'})
+ elif oldProps == 'motor/type' and obj[oldProps] == 'DC':
+ new_motor.update({newProps: 'generic_dc'})
else:
new_motor.update({newProps: obj[oldProps]})
+
if not 'motor/name' in new_motor.keys():
new_motor.update({'motor/name': obj.name + '_Motor'})
diff --git a/templates_py/phobos_convert_pre_1_0_models.py b/templates_py/phobos_convert_pre_1_0_models.py
index 9ff260e6b..2396c8d5f 100644
--- a/templates_py/phobos_convert_pre_1_0_models.py
+++ b/templates_py/phobos_convert_pre_1_0_models.py
@@ -1,21 +1,12 @@
-# TODO SHEBANG
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/templates_py/phobos_merge_armatures.py b/templates_py/phobos_merge_armatures.py
index a84bcc6ea..a8cf8c590 100644
--- a/templates_py/phobos_merge_armatures.py
+++ b/templates_py/phobos_merge_armatures.py
@@ -1,21 +1,12 @@
-# TODO SHEBANG
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/templates_py/phobos_merge_common_parent_visuals.py b/templates_py/phobos_merge_common_parent_visuals.py
index 31c615161..0399e6df7 100644
--- a/templates_py/phobos_merge_common_parent_visuals.py
+++ b/templates_py/phobos_merge_common_parent_visuals.py
@@ -1,21 +1,12 @@
-# TODO SHEBANG
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/templates_py/phobos_reorient_mesh.py b/templates_py/phobos_reorient_mesh.py
index 064b7ced8..92c566ac0 100644
--- a/templates_py/phobos_reorient_mesh.py
+++ b/templates_py/phobos_reorient_mesh.py
@@ -1,21 +1,12 @@
-# TODO SHEBANG
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/templates_py/phobos_replace_joint_shapes_from_resources.py b/templates_py/phobos_replace_joint_shapes_from_resources.py
index 7f7030350..ecbf99dbf 100644
--- a/templates_py/phobos_replace_joint_shapes_from_resources.py
+++ b/templates_py/phobos_replace_joint_shapes_from_resources.py
@@ -1,21 +1,12 @@
-# TODO SHEBANG
+#!/usr/bin/python3
+# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
-# Copyright (C) 2018 University of Bremen & DFKI GmbH Robotics Innovation Center
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
# -------------------------------------------------------------------------------
import bpy
diff --git a/testrunner.py b/testrunner.py
new file mode 100755
index 000000000..000404d24
--- /dev/null
+++ b/testrunner.py
@@ -0,0 +1,40 @@
+#!/usr/bin/python3
+
+# -------------------------------------------------------------------------------
+# This file is part of Phobos, a Blender Add-On to edit robot models.
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
+# -------------------------------------------------------------------------------
+
+import glob
+import subprocess
+import sys
+
+blenderExecutable = 'blender'
+
+# allow override of blender executable (important for CI!)
+if len(sys.argv) > 1:
+ blenderExecutable = sys.argv[1]
+
+# run all tests before aborting build
+testfailed = False
+
+# iterate over each *.test.blend file in the "tests" directory
+# and open up blender with the .test.blend file and the corresponding .test.py python script
+for file in glob.glob('tests/**/*.test.blend'):
+ print('#' * 100)
+ print('Running {} tests...'.format(file))
+ print('#' * 100)
+ code = subprocess.call([blenderExecutable, '--addons', 'phobos', '--factory-startup',
+ '-noaudio', '-b', file, '--python', file.replace('.blend', '.py'),
+ '--python-exit-code', '1'])
+ print('#' * 100)
+ print("Exited with: ", code)
+ print('#' * 100 + '\n\n\n')
+ if code:
+ testfailed = True
+
+if testfailed:
+ sys.exit(1)
diff --git a/tests/basics/basics.test.blend b/tests/basics/basics.test.blend
new file mode 100644
index 000000000..ad80f9ddb
Binary files /dev/null and b/tests/basics/basics.test.blend differ
diff --git a/tests/basics/basics.test.py b/tests/basics/basics.test.py
new file mode 100644
index 000000000..019c6cbe9
--- /dev/null
+++ b/tests/basics/basics.test.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python3
+
+# -------------------------------------------------------------------------------
+# This file is part of Phobos, a Blender Add-On to edit robot models.
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
+# -------------------------------------------------------------------------------
+
+import sys
+import unittest
+
+try:
+ import phobos
+
+ class TestPhobosAddon(unittest.TestCase):
+
+ def test_addon_enabled(self):
+ # test if addon got loaded correctly
+ # every addon must provide the "bl_info" dict
+ self.assertIsNotNone(phobos.bl_info)
+
+ # we have to manually invoke the test runner here, as we cannot use the CLI
+ suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestPhobosAddon)
+ success = unittest.TextTestRunner().run(suite)
+
+ if success.errors or success.failures:
+ raise Exception
+except Exception:
+ sys.exit(1)
diff --git a/tests/testmodel/testmodel.test.blend b/tests/testmodel/testmodel.test.blend
new file mode 100644
index 000000000..ad80f9ddb
Binary files /dev/null and b/tests/testmodel/testmodel.test.blend differ
diff --git a/tests/testmodel/testmodel.test.py b/tests/testmodel/testmodel.test.py
new file mode 100644
index 000000000..c8ca11093
--- /dev/null
+++ b/tests/testmodel/testmodel.test.py
@@ -0,0 +1,77 @@
+#!/usr/bin/python3
+
+# -------------------------------------------------------------------------------
+# This file is part of Phobos, a Blender Add-On to edit robot models.
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
+# -------------------------------------------------------------------------------
+
+import sys
+import unittest
+
+try:
+ import phobos
+
+ class TestInertiaModel(unittest.TestCase):
+
+ def test_calculateBoxInertia(self):
+ mass = 12
+ size = [1, 2, 3]
+ result = (13., 0., 0., 10., 0., 5.)
+
+ self.assertTupleEqual(phobos.model.inertia.calculateBoxInertia(mass, size), result)
+
+ def test_calculateCylinderInertia(self):
+ mass = 12
+ radius = 2
+ height = 5
+ result = (37., 0., 0., 37., 0., 24.)
+
+ self.assertTupleEqual(
+ phobos.model.inertia.calculateCylinderInertia(mass, radius, height), result)
+
+ def test_calculateSphereInertia(self):
+ mass = 12
+ radius = 2
+ target = [19.2, 0., 0., 19.2, 0., 19.2]
+
+ # we need to round the result, as machine precision fails us here...
+ result = phobos.model.inertia.calculateSphereInertia(mass, radius)
+ result = [round(val, 1) for val in result]
+ self.assertEqual(result, target)
+
+ def test_calculateEllipsoidInertia(self):
+ mass = 5
+ size = [1, 2, 3]
+ result = (13, 0, 0, 10, 0, 5)
+
+ self.assertTupleEqual(phobos.model.inertia.calculateEllipsoidInertia(mass, size),
+ result)
+
+ def test_inertiaListToMatrix(self):
+ inertialist = [1, 2, 3, 4, 5, 6]
+ result = [[1., 2., 3.], [2., 4., 5.], [3., 5., 6.]]
+
+ self.assertListEqual(
+ list(list(elem) for elem in phobos.model.inertia.inertiaListToMatrix(inertialist)),
+ result)
+
+ def test_inertiaMatriToList(self):
+ matrix = [[1, 2, 3], [2, 4, 5], [3, 5, 6]]
+ result = [1, 2, 3, 4, 5, 6]
+
+ self.assertListEqual(list(phobos.model.inertia.inertiaMatrixToList(matrix)), result)
+
+ # TODO continue with joints
+
+ # we have to manually invoke the test runner here, as we cannot use the CLI
+ suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestInertiaModel)
+ success = unittest.TextTestRunner().run(suite)
+
+ if success.errors or success.failures:
+ raise Exception
+
+except Exception:
+ sys.exit(1)
diff --git a/tests/testutils/testutils.test.blend b/tests/testutils/testutils.test.blend
new file mode 100644
index 000000000..ad80f9ddb
Binary files /dev/null and b/tests/testutils/testutils.test.blend differ
diff --git a/tests/testutils/testutils.test.py b/tests/testutils/testutils.test.py
new file mode 100644
index 000000000..4c3ee423d
--- /dev/null
+++ b/tests/testutils/testutils.test.py
@@ -0,0 +1,232 @@
+#!/usr/bin/python3
+
+# -------------------------------------------------------------------------------
+# This file is part of Phobos, a Blender Add-On to edit robot models.
+# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
+#
+# You should have received a copy of the 3-Clause BSD License in the LICENSE file.
+# If not, see .
+# -------------------------------------------------------------------------------
+
+import sys
+import unittest
+
+try:
+ import mathutils as mathutils
+ import phobos
+
+ class TestBlenderUtils(unittest.TestCase):
+
+ def test_compileEnumPropertyList(self):
+ testlist = phobos.utils.blender.compileEnumPropertyList([1, 2, 3])
+ self.assertTupleEqual(tuple(testlist), ((1, 1, 1), (2, 2, 2), (3, 3, 3)))
+
+ class TestGeneralUtils(unittest.TestCase):
+
+ def test_is_float(self):
+ self.assertTrue(phobos.utils.general.is_float('12.3'))
+ self.assertFalse(phobos.utils.general.is_float('hello'))
+ self.assertFalse(phobos.utils.general.is_float('[12.3, 3.2]'))
+
+ def test_is_int(self):
+ self.assertTrue(phobos.utils.general.is_int('12'))
+ self.assertFalse(phobos.utils.general.is_int('hello'))
+ self.assertFalse(phobos.utils.general.is_int('12.3452234'))
+ self.assertFalse(phobos.utils.general.is_int('[12, 3]'))
+
+ def test_parse_number(self):
+ number = phobos.utils.general.parse_number('12')
+ self.assertEqual(type(number), type(1))
+ number = phobos.utils.general.parse_number('12.124')
+ self.assertEqual(type(number), type(12.124))
+ number = phobos.utils.general.parse_number('hello')
+ self.assertEqual(type(number), type('hello'))
+
+ def test_only_contains_int(self):
+ testlist = [1, 2, 3, 4, 5]
+ self.assertTrue(phobos.utils.general.only_contains_int(testlist))
+ testlist = [1, 2, 3, 4, 5, 12.3]
+ self.assertTrue(phobos.utils.general.only_contains_int(testlist))
+ testlist = [1, 2, 3, 4, 5, 'hello']
+ self.assertFalse(phobos.utils.general.only_contains_int(testlist))
+
+ def test_only_contains_float(self):
+ testlist = [1.1, 2.1, 3.5, 4.7, 5.6]
+ self.assertTrue(phobos.utils.general.only_contains_float(testlist))
+ testlist = [1.1, 2.1, 3.5, 4.7, 5.6, 12]
+ self.assertTrue(phobos.utils.general.only_contains_float(testlist))
+ testlist = [1.1, 2.1, 3.5, 4.7, 5.6, 'hello']
+ self.assertFalse(phobos.utils.general.only_contains_float(testlist))
+
+ def test_parse_text(self):
+ teststring = '1 2 3 4 5'
+ self.assertListEqual(phobos.utils.general.parse_text(teststring), [1, 2, 3, 4, 5])
+ teststring = '1.1 2.1 3.4 4.7 5.1'
+ self.assertListEqual(phobos.utils.general.parse_text(teststring), [
+ 1.1, 2.1, 3.4, 4.7, 5.1])
+ teststring = 'a bc de hello whatsoever'
+ self.assertListEqual(phobos.utils.general.parse_text(teststring), [
+ 'a', 'bc', 'de', 'hello', 'whatsoever'])
+ teststring = '12.3'
+ self.assertEqual(phobos.utils.general.parse_text(teststring), 12.3)
+ teststring = '12'
+ self.assertEqual(phobos.utils.general.parse_text(teststring), 12)
+
+ def test_calcBoundingBoxCenter(self):
+ corners = [
+ [0., 0., 0.],
+ [1., 0., 0.],
+ [1., 0., 1.],
+ [0., 0., 1.],
+ [0., 1., 0.],
+ [1., 1., 0.],
+ [1., 1., 1.],
+ [0., 1., 1.]
+ ]
+ self.assertEqual(phobos.utils.general.calcBoundingBoxCenter(corners),
+ mathutils.Vector([0.5, 0.5, 0.5]))
+
+ corners = [
+ [-1., -1., -1.],
+ [1., -1., -1.],
+ [1., -1., 1.],
+ [-1., -1., 1.],
+ [-1., 1., -1.],
+ [1., 1., -1.],
+ [1., 1., 1.],
+ [-1., 1., 1.]
+ ]
+ self.assertEqual(phobos.utils.general.calcBoundingBoxCenter(corners),
+ mathutils.Vector([0., 0., 0.]))
+
+ def test_sortListsInDict(self):
+ testdict = {'a': 1, 'b': [15, 12, 4, -3], 'c': ['delta', 'gamma', 'yota', 'omega'],
+ 'd': 'hello', 'e': [12.3, 14, 'meh']}
+ targetdict = {'a': 1, 'b': [15, 12, 4, -3], 'c': ['delta', 'gamma', 'omega', 'yota'],
+ 'd': 'hello', 'e': [12.3, 14, 'meh']}
+ self.assertEqual(phobos.utils.general.sortListsInDict(testdict), targetdict)
+ testdict = ['omega', 'delta', 'alpha', 'eta']
+ targetdict = ['alpha', 'delta', 'eta', 'omega']
+ self.assertListEqual(phobos.utils.general.sortListsInDict(testdict), targetdict)
+ testdict = ['omega', 'delta', 'alpha', 'eta']
+ targetdict = ['omega', 'eta', 'delta', 'alpha']
+ self.assertListEqual(phobos.utils.general.sortListsInDict(testdict, reverse=True),
+ targetdict)
+ # TODO adjust docstring to include string only?
+
+ def test_roundFloatsInDict(self):
+ testdict = {'a': 1, 'b': [12.545, -3.111, -3.894, 15.25, -0.111],
+ 'c': ['delta', 'alpha', 'gamma']}
+ targetdict = {'a': 1, 'b': [13., -3., -4., 15., 0.], 'c': ['delta', 'alpha', 'gamma']}
+ self.assertEqual(phobos.utils.general.roundFloatsInDict(testdict, 0), targetdict)
+ targetdict = {'a': 1, 'b': [12.5, -3.1, -3.9, 15.2, -0.1],
+ 'c': ['delta', 'alpha', 'gamma']}
+ self.assertEqual(phobos.utils.general.roundFloatsInDict(testdict, 1), targetdict)
+ targetdict = {'a': 1, 'b': [12.54, -3.11, -3.89, 15.25, -0.11],
+ 'c': ['delta', 'alpha', 'gamma']}
+ self.assertEqual(phobos.utils.general.roundFloatsInDict(testdict, 2), targetdict)
+
+ def test_datetimeFromIso(self):
+ # TODO add test case for ISO time
+ pass
+
+ def test_outerProduct(self):
+ a = [0, 1, 2]
+ b = [3, 4, 5]
+ result = [[0., 0., 0.], [3., 4., 5.], [6., 8., 10.]]
+ self.assertListEqual(list(list(elem) for elem in
+ phobos.utils.general.outerProduct(a, b)), result)
+
+ class TestIOUtils(unittest.TestCase):
+
+ def test_xmlline(self):
+ tag = 'helloworld'
+ names = ['number', 'name', 'stuff']
+ values = [12.3, 'bert', ['a', 'b', 'c']]
+ target = '\n'.format(
+ "'a'", "'b'", "'c'")
+
+ self.assertEqual(phobos.utils.io.xmlline(0, tag, names, values), target)
+ self.assertEqual(phobos.utils.io.xmlline(3, tag, names, values), phobos.utils.io.indent
+ * 3 + target)
+
+ def test_l2str(self):
+ testlist = [1, 2, 'hello', '-1']
+ target = '1 2 hello -1'
+ self.assertEqual(phobos.utils.io.l2str(testlist), target)
+ target = '2 hello -1'
+ self.assertEqual(phobos.utils.io.l2str(testlist, start=1), target)
+ target = '2'
+ self.assertEqual(phobos.utils.io.l2str(testlist, start=1, end=-2), target)
+ target = ''
+ self.assertEqual(phobos.utils.io.l2str(testlist, start=5, end=-8), target)
+
+ class TestNamingUtils(unittest.TestCase):
+
+ def test_getUniqueName(self):
+ testname = 'bert'
+ testlist = ['gunther', 'bert', 'walter']
+ target = 'bert.000'
+ self.assertEqual(phobos.utils.naming.getUniqueName(testname, testlist), target)
+
+ testname = 'b' * 70
+ testlist = ['gunther', 'b' * 70, 'walter']
+ target = 'b' * 59 + '.000'
+ self.assertEqual(phobos.utils.naming.getUniqueName(testname, testlist), target)
+
+ def test_isValidModelname(self):
+ testname = 'helloworld'
+ self.assertTrue(phobos.utils.naming.isValidModelname(testname))
+ testname = 'asnd_123_ppja-'
+ self.assertTrue(phobos.utils.naming.isValidModelname(testname))
+ testname = '124%£DJFLL:'
+ self.assertFalse(phobos.utils.naming.isValidModelname(testname))
+ testname = ''
+ self.assertFalse(phobos.utils.naming.isValidModelname(testname))
+ testname = ' '
+ self.assertFalse(phobos.utils.naming.isValidModelname(testname))
+
+ def test_addNamespaceToName(self):
+ testname = 'bert'
+ namespace = 'robot'
+ target = 'robot::bert'
+ self.assertEqual(phobos.utils.naming.addNamespaceToName(testname, namespace), target)
+ testname = 'robot::bert'
+ namespace = 'model'
+ target = 'model::robot::bert'
+ self.assertEqual(phobos.utils.naming.addNamespaceToName(testname, namespace), target)
+
+ def test_stripNamespaceFromName(self):
+ testname = 'robot::bert'
+ target = 'bert'
+ self.assertEqual(phobos.utils.naming.stripNamespaceFromName(testname), target)
+ testname = 'model::robot::bert'
+ target = 'bert'
+ self.assertEqual(phobos.utils.naming.stripNamespaceFromName(testname), target)
+ testname = 'robot::'
+ target = ''
+ self.assertEqual(phobos.utils.naming.stripNamespaceFromName(testname), target)
+ testname = '::'
+ target = ''
+ self.assertEqual(phobos.utils.naming.stripNamespaceFromName(testname), target)
+ testname = ''
+ target = ''
+ self.assertEqual(phobos.utils.naming.stripNamespaceFromName(testname), target)
+
+ # we have to manually invoke the test runner here, as we cannot use the CLI
+ blenderutilstest = unittest.defaultTestLoader.loadTestsFromTestCase(TestBlenderUtils)
+ generalutilstest = unittest.defaultTestLoader.loadTestsFromTestCase(TestGeneralUtils)
+ ioutilstest = unittest.defaultTestLoader.loadTestsFromTestCase(TestIOUtils)
+ namingutilstest = unittest.defaultTestLoader.loadTestsFromTestCase(TestNamingUtils)
+
+ results = []
+ results.append(unittest.TextTestRunner().run(blenderutilstest))
+ results.append(unittest.TextTestRunner().run(generalutilstest))
+ results.append(unittest.TextTestRunner().run(ioutilstest))
+ results.append(unittest.TextTestRunner().run(namingutilstest))
+
+ for result in results:
+ if result.errors or result.failures:
+ raise Exception
+except Exception:
+ sys.exit(1)