Commit Graph

17 Commits

Author SHA1 Message Date
Chris Want
27c42ee062 A fix for an indentation error, and better handling of faces with
images when materials are defined for the face (i.e., only use
the image as a texture in this case if 'Texface' is selected
for the material).
2006-11-17 16:11:03 +00:00
Chris Want
05c59da48f Fix for bug #4922
The VRML97 exporter was rounding a lot of stuff to three decimal points.
This is silly, since the spec says single-precision floats are used for
most things, which gives about 7 decimal points precision.
2006-11-11 19:12:43 +00:00
Chris Want
1f68dfb499 A mesh from the Blender python Mesh module can sometimes have
a materials array with entries that are 'None'. Added some code
to check for this perverse situation.
2006-08-16 01:06:38 +00:00
Chris Want
6122d501e7 Converting a mesh object with modifiers to a temporary mesh during
export would cause a problem since the temporary meshes created
would often reuse the same name for many objects. This fix mangles
the object name and uses this for the temporary mesh name to avoid
this problem. (The naming is important, since vrml has 'DEF' and 'USE'
statements that are used like C macros, so if two meshes have the
same name the exporter will try to 'recycle' data to keep file sizes
low).
2006-07-19 13:05:11 +00:00
Chris Want
62420c88fd Hrmm, this is a bit nasty: I am now using a different call to get a mesh
for export depending on whether the object containing the data has
modifiers or not. For an object without modifiers, things are nice since
the mesh can be properly instanced and reused. For an object with
modifiers there are problems, since a new Mesh has to be created,
akin to doing an Alt-C on the mesh, and we end up using more memory
after the use of the script than we used beforehand. (I wonder if
I would be better off porting the thing to C.)
2006-05-19 17:28:17 +00:00
Chris Want
594b0bf041 Two issues:
* a misuse of the Mesh module meant that I kept creating new
  meshes each time the script was run;

* the commas in the vertex color export looked weird.
2006-05-18 20:47:39 +00:00
Chris Want
d41fd9079d A fairly major revision of the VRML97 export script.
Changes include, but may not be limited to:

* Support for meshes with multiple materials/face images
* Mode modular design that more closely reflects Blender's
  internal workings
* Position, scale, and orientations are now exclusively dealt
  with in Transform nodes, making the math more unified and
  way easier to understand.
* vertex colors either written when mesh has SHARED_COL
  face property, or when mesh has vertex colors and
  first material with VCOL_PAINT (a little crufty, but
  maybe will try a better way later)
* Support for debugging output to the console by setting
  the 'rt' button to 42 (for mild verbosity) or 43 (for more
  verbosity)
* Potentially long lists like vertex coordinates, face indices,
  etc. are now unindented (why potentially waste thousands of
  tab characters?)
* All lines in the script are under 79 characters (as per the
  python style guide).

A major revision will usually beget major bugs, so
please test, test, test to make sure I haven't broken your favorite
feature in this script! (I've done a number of tests loading
output into the Bitmanagement viewer and into 3DSMax.)
2006-05-18 17:34:41 +00:00
Campbell Barton
0d8f85eda8 made some changes to vrml97_export, this script needs to be re-written, until then fixed some incorrect assumtions it made- was using the first world in the list for AMB color no matter what world was being used, was also using the image name rather then the file name for its image URL references. 2006-05-16 22:57:24 +00:00
Chris Want
baf69d3a73 Making the vrml exporter use the Ken Hughes Mesh module, rather
than NMesh.
2006-05-12 15:26:38 +00:00
Chris Want
d3dd1da8d4 The algorithm to export vertex color was very inefficient (for every
vertex it would potentially loop through every face). This fix speeds
it up a bit (only loops through all faces once, at the cost of some
additional memory). An example of export times for a mesh with 6266
verts and 12528 faces:

Before: 2m56s
After:     8s
2006-05-11 17:42:58 +00:00
Chris Want
cfbbd8a54e Some bad logic was causing an 'Appearance' node not to get closed
correctly when a mesh has vertex colors.
2006-05-11 17:29:44 +00:00
Chris Want
2358e85b6d Converting spaces to tabs in this script (this is standard!) 2006-05-10 21:37:03 +00:00
Willian Padovani Germano
4b01aa7aa5 Scripts:
The orange -> HEAD merge reverted some scripts to older versions. This only
affected the ones that already existed before the orange branch.
Minor issue, easy to fix.

All in all, kudos to kaito, Hos and others for all the hard work in
bringing (coding, merging) all these changes to the main branch.
2006-01-29 19:17:53 +00:00
Kent Mein
af890a6270 Bart updated his scripts...
Fixes:
- naming of Transform instead of Shape node
        X3D exporter: line 431 and 432
        VRML exporter: line 430 and 433
- wrong import of modules in the X3D exporter
        line 72
2005-06-06 19:00:02 +00:00
Willian Padovani Germano
b7be4525bd Scripts: updated Bart's (thanks) vrml97 and x3d exporters, adding also doc link to the script's web page and commenting out two uneeded prints in each script. 2005-05-22 18:50:46 +00:00
Willian Padovani Germano
859959b49c BPython:
- fixing bug reported by Paolo Colombo: space handler slinks set for a 3d view were not set when the area got maximized;
- Blender.Object: added object.isSB() method to know if an object is a soft body (has ob->soft != NULL).  Used in fixfromarmature.py.

Scripts:
- updates: batch_name_edit (Campbell), fixfromarmature (JMS);
- additions:
   X3D exporter by Bart;
   Envelope Suite by Jonas Petersen;
   BVH 2 Armature by Jean-Baptiste Perin;
   Camera Changer by Regis Montoya (3R);
   Interactive Console by Campbell (ideasman).
- tiny updates in other scripts.
2005-05-17 07:17:52 +00:00
Willian Padovani Germano
d65fc84a68 Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!).  It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version.  For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System).  Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago.  For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9

BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode.  Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves.  This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True).  Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00