Changeset View
Changeset View
Standalone View
Standalone View
tests/python/demo_file_generator.py
- This file was added.
| # ##### BEGIN GPL LICENSE BLOCK ##### | |||||
| # | |||||
| # 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 2 | |||||
| # 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, write to the Free Software Foundation, | |||||
| # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||||
| # | |||||
| # ##### END GPL LICENSE BLOCK ##### | |||||
| # <pep8 compliant> | |||||
| import bpy | |||||
| import sys | |||||
| import os | |||||
| from pathlib import Path | |||||
| sys.path.append(os.path.dirname(os.path.realpath(__file__))) | |||||
| from modules.object_generator import TestObject, GenerateTestObject | |||||
| def main(): | |||||
| create_test_object_list = [ | |||||
| TestObject("myCollection", {'Plane': 'primitive_plane_add'}), | |||||
| TestObject("SurfaceDeform", {'Cube': 'primitive_cube_add'}), | |||||
zazizizou: having duplicates means the given name by the user won't actually match the one created. So the… | |||||
Done Inline Actionsthe user still would have to check the names anyway to get an idea, the create duplicates parameter is optional. With test object and exp object names starting from 0 calra: the user still would have to check the names anyway to get an idea, the create duplicates… | |||||
Not Done Inline ActionsPrefer no abbreviations in interface, so vertex_group_name instead of vg_name zazizizou: Prefer no abbreviations in interface, so `vertex_group_name` instead of `vg_name` | |||||
| ] | |||||
| gen_object = GenerateTestObject("C:/Users/Lenovo/Desktop/", "x_file3.blend", create_test_object_list) | |||||
| gen_object.create() | |||||
Not Done Inline ActionsGenerated files shouldn't use hard coded path. campbellbarton: Generated files shouldn't use hard coded path. | |||||
Done Inline ActionsDidn't understand, if its a utiltity. User can type their own paths. This is just an example on how to use it. calra: Didn't understand, if its a utiltity. User can type their own paths. This is just an example on… | |||||
| if __name__ == "__main__": | |||||
| main() | |||||
having duplicates means the given name by the user won't actually match the one created. So the user has to check for names manually before writing the tests. Is this desired?