The fbx plugin won't compile using gcc 4.3.2. I made the following
minor changes:
1. WriterNodeVisitor.cpp needed limits.h added to the headers.
2. gcc does not allow structures to be defined inside of functions, so
I moved the definition of PolygonRef out of the function to a global
scope (right above the function readMesh).
I also removed a bunch of embedded carriage returns
- missing copy attribute _referenceFrame in ClipNode in copy constructor
- checked iterators against the end in osgText
- close codec context in ffmpeg plugin to avoid memory leak
"
"enable thread locking in libavcodec
This is required for a multithreaded application using ffmpeg from
another thread."
"Prevent the audio from videos from hanging on exit if they are paused.
The video decoder already has similar logic."
"Add a way to retrieve the creation time for MPEG-4 files."
"fmpeg, improve wait for close logic
Both audio and video destructors have been succesfully using the logic,
if(isRunning())
{
m_exit = true;
join();
}
since it was introduced,
but the close routines are using,
m_exit = true;
if(isRunning() && waitForThreadToExit)
{
while(isRunning()) { OpenThreads::Thread::YieldCurrentThread(); }
}
which not only is it doing an unnecessary busy wait, but it doesn't
guaranteed that the other thread has terminated, just that it has
progressed far enough that OpenThreads has set the thread status as
not running. Like the destructor set the m_exit after checking
isRunning() to avoid the race condition of not getting to join()
because the thread was running, but isRunning() returns false.
Now that FFmpeg*close is fixed, call it from the destructor as well
to have that code in only one location."
uncovered what looks like a type in the "src\osgPlugins\dae\
daeRMaterials.cpp" file. Line 1094 reads:
^^^
parameters.filter_min = getFilterMode(sampler->getMagfilter()->
getValue(), false);
whereas it should read
^^^
parameters.filter_mag = getFilterMode(sampler->getMagfilter()->
getValue(), false);
"
Out application has the ability to switch to different types of terrains on the fly. This problem only exists in this type of situation.
The TXPArchive is held by the ReadWriterTXP class. When the TXPNode, which is the top level node, is released from memory, the archive associated to that TXPNode is also released. The issue is that the reference count on the TXPArchive never gets to zero.
The reason why the reference count never gets to zero is because the TXPParse, which is owned by the TXPArchive, stores a ref_ptr to the TXPArchive. You can then see why this becomes a problem. The TXPParser's ref_ptr cannot be unreferenced since the TXPArchive has not released the TXPParser.
Since the TXPParser is fully contained within the TXPArchive, I don't see the reason to have the TXPParser have a ref_ptr to the TXPArchive. I've made this change locally and have had no problems and our memory leak has been fixed.
"
The file FFmpegHeaders.hpp sets this definition. However, if stdint.h is
already included through other files, it won't take any effect.
Include FFmpeg headers as early as possible in order to avoid stdint.h being
included on other paths.
"
I don't understand the changes to ReaderWriterFBX.cpp - (i) strings.h isn't a standard header, (ii) the ISO-conformant form is _strnicmp (with the underscore). Does the existing code not compile for you? If not we'll have to do some #ifdef nastiness."
A problem with transparency has also been fixed: objects were transparent wrt themselves but were opaque wrt to other objects.
Finally I added the support for "mixing factors" of diffuse, reflective and opacity textures/values.
From Michael Platings: added "LightmapTextures" plugin option that changes the way textures are interpreted so Alessandro's models appear correctly. Also refactored to put many functions in one class to avoid passing around too many arguments to functions.
one error in the rgb loader.
Previously we limited the current line to the image with + 1. With that change
it is correctly limited to the width of the image.
Also flightgear seems to run nice with that change.
"
the OutputStream/InputStream implementations, which was just finished
last weekend with a few tests on Windows and Ubuntu. Hope it could
work and get more feedbacks soon.
I've added a new option "SchemaData" to the osg2 plugin. Developers
may test the new feature with the command line:
# osgconv cow.osg cow.osgb -O SchemaData
It will record all serializer properties used in the scene graph, at
the beginning of the generated file. And when osgviewer and user
applications is going to read the osgb file, the inbuilt data will be
automatically read and applied first, to keep backwards compatibility
partly. This will not affect osgb files generated with older versions.
"
JIV:"I deleted a line from the ReaderWriterDAE.cpp file that was introduced in rev 11341. I got a crash on this line when the options pointer was NULL."
MP:"Good spot John. The next line is also unnecessary and can be removed as well (attached, plus some minor code beautifying)"
CURL_LIBRARY_DEBUG and ZLIB_LIBRARY_DEBUG. Previously it linked the
debug version against the release libs, which was causing a hang when
running in debug mode on Windows."
modifications of the osgShadow header naming styles as well. The
osgDB::Serializer header is also changed to add new Vec2 serializer
macros because of the needs of osgShadow classes. It should compile
fine on both Windows and Linux. But I have only done a few tests to
generate .osgb, .osgt and .osgx formats with these new wrappers."
Mathieu Marache, he added the last missing piece to this puzzle.
I think it is safe to commit these changes to trunk, as the traditional
way via dylibs should work as before.
Here's some more info how to get frameworks:
With these modifications it is possible to compile frameworks on OS X,
when you set the Cmake-option OSG_COMPILE_FRAMEWORKS to true. If you
want to embed the frameworks in your app-bundle make sure to set
OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR accordingly.
You'll have to build the install-target of the generated xcode-projects
as this sets the install_name_dirs of the frameworks and plugins."
few headers and the osgAnimation sources are also modified to make
everything goes well, including:
A new REGISTER_OBJECT_WRAPPER2 macro to wrap classes like
Skeleton::UpdateSkeleton.
A bug fix in the Seralizer header which avoids setting default values
to objects.
Naming style fixes in osgAnimation headers and sources, also in the
deprecated dotosg wrappers.
A bug fix for the XML support, to write char values correctly.
A small change in the osg::Geometry wrapper to ignore the
InternalGeometry property, which is used by the MorphGeometry and
should not be set by user applications.
The avatar.osg, nathan.osg and robot.osg data files all work fine with
serializers, with some 'unsupported wrapper' warnings when converting.
I'm thinking of removing these warnings by disabling related property
serializers (ComputeBoundingBoxCallback and Drawable::UpdateCallback),
which are seldom recorded by users.
By the way, I still wonder how would we handle the C4121 problem,
discussed some days before. The /Zp compile option is set to 16 in the
attached cmake script file. And is there a better solution now?"
a byte order issue.
The problem is that osg::SwapBytes code has been copied from the old
plugin to the new one, but the latest lib3ds also incorporates code to
handle byte ordering in read & writing. So the net result is that the
swap is done twice.
The solution is simply to remove the custom osg code, and use the
stock lib3ds code. The attached files are against today's revision
11331. I've tested on Sparc & Intel.
"
- Fixed handling of MatrixTransforms (still doesn't support other Transforms types). Fixes things for OSG, DeepExploration, 3DSMax...
- Added support for writing double precision vertices by converting them.
- Added base code for future compatibility option (3rd-party apps that don't read animation data). See "DISABLE_3DS_ANIMATION" compile flag."
The plugin can now handle embeded PixelTexture fields in addition to the
already implemented ImageTexture fields.
Fixed a bug with texture repeat being applied to the wrong texture dimension.
Added handling for IndexedLineSet geometries."
- Replaced exceptions with assert() or OSG_NOTIFY
- Replaced osg::notify() with OSG_NOTIFY
- Changed braces and tabs to fit OSG coding convention
- Cleaned a few things in code (names, added deallocations upon error)"
And by refactoring a bit of code, I may have fixed some StateSets related bugs (was ignoring StateSets for osg::Groups).
I also added support for Billboard's points, so now "osgconv lz.osg lz.3ds" has an acceptable output. However, there is no rotation depending on billboards' axis, hence the notice "Warning: 3DS writer is incomplete for Billboards (rotation not implemented).". You may want to remove this notice (or lower the notify severity) if you feel 3DS doesn't have to handle such rotations.
The attached archive contains 3 files from 3DS plugin, against rev. 11162.
Please note there is still the textures issue for cow.osg. I guess it's because it's not a "flat, dummy and standard" texture in slot 0... That is to say the only thing the writer can handle at the moment. I guess I won't address this soon.
"
and
"I've detected and fixed another bug in 3DS writer: support for automatic splitting of meshes having >65k faces/points was buggy (was deleting faces).
Here is my four 3DS modified files (in a ZIP), against rev. 11193, including previous fixes AND Stephan's fix about relative filenames."
using osgDB::XmlParser. The extension for XML-formatted scenes is
.osgx, corresponding to .osgb for binary and .osgt for ascii. It could
either be rendered in osgviewer or edited by common web browsers and
xml editors because of a range of changes to fit the XML syntax. For
example, the recorded class names are slight modified, from
'osg::Geode' to 'osg--Geode'.
To quickly get an XML file:
# ./osgconv cow.osg cow.osgx
The StreamOperator header, InputStreram and OutputStream classes are
modified to be more portable for triple ascii/binary/XML formats. I
also fixed a bug in readImage()/writeImage() to share image objects if
needed.
The ReaderWriterOSG2 class now supports all three formats and
reading/writing scene objects (not nodes or images), thanks to
Torben's advice before.
"
absolute filenames for the texture images.
The attached change should fix this by at first looking at the absolute file
name to load a texture and then, if that fails, strip away any paths to try
that again with the bare file name.
The change also fixes a possible exception that could be triggered by an out
of bounds std::string access which is now avoided by using functions from
osgDB/FileUtils.
The change is based on rev 11161."
Attached you will find updates of the files to hopefully solve the warnings (in VS2005 only one warning occured). In addition I fixed a tiny bug that caused a crash with one of my test files."
options->setPluginStringData("captureVideoDevice", "0");
Lines added in getDevice() are:
int deviceId = atoi(name.c_str());
if(deviceId >= 0 && deviceId < (int)_listDevice.size())
return _listDevice[deviceId];
This makes it easy to use a capture device without knowing it's name. Attached is the whole file against rev 11044"
osgAnimation. It's been tested with the majority of the samples in the
COLLADA test repository and works with all of them either as well as, or
better than, the version of the plugin currently in SVN.
Known issue: vertex animation (AKA morphing) doesn't work at present,
but that's a relatively unpopular method of animating so it's not high
on my priority list."
Follow up email:
"I've been informed that the previous DAE submission didn't build on
unix, so here's the submission again with the fixes. Thanks to Gregory Potdevin and Benjamin Bozou.
Also, my apologies to Roland for not crediting his part in making DAE
animation happen, my work was indeed built on top of his work. Thanks
also to Marius Heise and of course Cedric Pinson."
Changes by Robert Osfield, fixed compile issues when compile without C* automatic conversion enabled in ref_ptr<>
and constructor initialization fixes to address some warnings under gcc.
png_set_expand_gray_1_2_4_to_8() with the 1.2.9 release. This
submission fixes builds of the OSG against versions of libpng < 1.2.9
that don't have the new symbol available. This affects platforms like
Red Hat Enterprise Linux 4 which come with libpng 1.2.7."
- Improved identifiers generation in duplicate name handling (was limited to 1000 name collisions, which can be very short for some usages).
- Set all read/write operations use a custom log function that will redirect lib3DS log to osg::notify() (was only used for streams)
- Removed custom code (now uses osgDB::getFilePath())
- Added missing supportsOption() calls
- Cleaned a few minor things"
modified files, while GroupSoLOD.h and .cpp was deleted. Please, delete
it from repository, it is not used any longer and I doubt if it is
probably not used for anything meaningful for a while. In the new code,
there is no GroupSoLOD. Please, delete it.
I am using new plugin version for about 1.5 month so I consider it
stable by myself.
List of changes:
- rewritten Inventor state stack
- shaders support
- light attenuation support
- support for reading from stream (readNode(std::istream& fin, options))
- improved grouping node handling (SoSeparator, SoGroup,...)
- fixed transformation bug when two SoShapes/Drawables with different transformations are placed bellow one grouping node
- introduced preprocessing to handle more advanced usage schemes of SoLOD and SoSwitch nodes
- unused code clean up
- improved notify messages
- animation callbacks fixes
- FindInventor.cmake improved finding routines, support for Coin3 and Coin4"
1. Rewrite the reading/writing exception handlers to work like the ive
plugin exceptions.
2. Write a header writing/checking function in ReaderWriterOSG2.cpp,
which may help decide if the stream is ascii or binary. The
readInputIterator() function will return null pointer if the input
file is nither osgb nor osgt format, which indicates that the old .osg
format could be used here, in case we've merged the two plugins
together.
3. Add a new ForceReadingImage option in the InputStream, which will
allocate an empty image object with the filename if specifed external
image file is missed. It may be useful for format converting in some
cases.
4. Add new osgParticle wrappers, as well as some modification to the
osgParticle headers, for instance, change isEnabled() to getEnabled().
5. Some fixes to the osg serialization wrappers."
Bone now inherit from MatrixTransform. It simplify a lot the update of
Bone matrix. It helps to have the bone system more generic. eg it's now
possible to have animation data with precomputed bind matrix. The other
benefit, is now the collada plugin will be able to use osgAnimation to
display skinned mesh. Michael Plating did a great work to improve this
aspect, he is working on the collada plugin and should be able to submit
a new version soon.
The RigGeometry has been refactored so now it works when you save and
reload RigGeometry because the source is not touched anymore. The
benefit with this update is that it should be now possible to use a
MorphGeometry as source for a RigGeometry.
The bad news is that the format has changed, so i have rebuild osg-data
related to osgAnimation data, updated the blender exporter to export to
the new format.
The fbx plugin could be touched about this commit, i dont compile it so
i can't give more information about it.
The bvh plugin has been updated by Wang rui so this one is fixed with
the new code of osgAnimation.
The examples has been updated to work with the new code too...
The example osg-data/example.osg should be remove, it's an old example
that does not work.
For people using blender the blender exporter up to date is here:
http://hg.plopbyte.net/osgexport2/
it will be merge to http://hg.plopbyte.net/osgexport/ as soon as the
modification will be push in the trunk.
"
From Robert Osfield, refactor of Wang Rui's original osg2 into 3 parts - parts placed into osgDB, the ReaderWriter placed into src/osg/Plugin/osg and wrappers into src/osgWrappers/serializers/osg
1) Add getShadowComparison() accessor function to osg::Texture class
2) Modify ReaderWriterTiff::writeTifStream() and _readColor() (in Image.cpp) to handle pixelFormat==GL_DEPTH_COMPONENT as if it were GL_LUMINANCE
3) Modify the Texture classes of the ive and osg plug-ins so that they save/load the following Texture members: _use_shadow_comparison, _shadow_compare_func and _shadow_texture_mode
"
- Fixed creation of useless intermediate nodes
WriterNodeVisitor.cpp fixes:
- Fixed naming of textures (path and extension)
"
Note from Robert Osfield, this submission also came with changes to use of ref_ptr<> and removal of delete[]'s, but these were not merged as they didn't actually fix any memory leaks, and in once instance introduced one.
In particular, the case when the "instance_geometry" element has no "bind_material" sub-element. This is valid, according to the official collada 1.4.1 specification."
> loader to un-premultiply the alpha (now in the codebase).
Applying the code brightens the semi-transparent portion, but the black edges are still there (same on both osgviewer and FlightGear).
Therefore I believe that the alpha channel is completely ignored (on png, gif, tiff, etc...). I tweaked and tweaked and finally got a workaround.
Please commit the enclosed file to fix these issues.
My workaround is a bit tricky (and some lines are even weird for me), but it resolves the black edges.
These workarounds also work on GIF, TIFF, TGA, and PSD as long as I've tested so far.
Please read this for more info on this issue:
http://macflightgear.sourceforge.net/home/development-notes/devnote-dec-02-2009http://macflightgear.sourceforge.net/home/development-notes/devnote-dec-03-2009
I'm very happy if some of you guys find a better means of solving the black edges.
"
"Here is our freshly baked 3DS reader/writer (named 'v0.5' to differentiate from previous one). Changes are against trunk rev. 10819.
Short changelog (from rev 10819):
- Added 3DS writer
- Sync'd with latest lib3DS
- Added options, especially "flattenMatrixTransforms" to get the "old" behaviour (else the reader correctly maps to OSG the transforms from the 3DS file).
What should be done:
- Check with pivot points, with and without "flattenMatrixTransforms" option.
- We ran tests on it, but we can never be 100% sure there is no bug. Testing from the community would of course be helpful."
fixed a small bug then:
ReaderWriterPDF.cpp, line 133, change:
std::string uri = std::string("file:") + foundFile;
to:
#if defined(WIN32) && !defined(__CYGWIN__)
std::string uri = std::string("file:///") + foundFile;
#else
std::string uri = std::string("file:") + foundFile;
#endif
That's because glib accepts "file:///C:\\data\\file.pdf" as URIs on
Windows, as well as "file:/home/data/file.pdf" on Unix, but
"file:C:\\data\\file.pdf" is not recognized.
Now I could read my Chinese translation of OSGQSG with osgpdf. :P"
and so, if the .dot plugin was loaded, it would happily handle any file
name extension.
To reproduce the bug, first save a scene to a dot file (to load the dot
plugin), then try to write the scene to an osg file. If you look at the
osg file, you will see that it is a dot file."
.dds texture files from internally-embedded textures during IVE writes."
From Robert Osfield, fixed a bug in the above submission, and changed the way that the filename of the file is passed into DataOutputStream to avoid issues with the .ive's plugins ability to read from istreams.
functionality and I also modified osgmovie example to support "seek"."
Note from Robert Osfield, changes osgmovie to use '>' for the seek as '+' was already used in a separate submission that had been merged.
then reload a video and finally delete the second XineStreamImage.
In src/osgPlugins/xine/video_out_rgb.c, many code is ASM code, and 'clear()' function is one of them.
If OSG is compiled without the flag COMPILE_ASSEMBLY (default behaviours) the clear() function is an empty
function and allocated memory is never initialized to 0. So a structure which contain pointer haven't its pointer set to NULL.
And when we need to delete this pointer, all go bad.
I join the fixed file."
being able to accurately provide the cool stuff that SVG is good for. :)
There is a one-line bug on line 68 in the
src/osgPlugins/svg/ReaderWriterSVG.cpp file where you can set the width
in the Options string, but not the height."
synchronization, improve capture device support.
here how to use it to display a capture device:
osg::Options* options = new osg::Options;
options->setPluginStringData("captureWantedWidth", "800");
options->setPluginStringData("captureWantedHeight", "600");
options->setPluginStringData("captureWantedFps", "30");
options->setPluginStringData("captureVideoDevice", "USB Video Device" );
options->setPluginStringData("captureSoundDevice", "");
then
osgDB::readImageFile("capture.directshow", options)
you can use a graphedit application to list devices available in
directshow.
for classic avi file you just need to do a
osgDB::readImageFile("file.avi.directshow");
You will need of course to install the codec needed by directshow to
read the avi files.
I recommand this tool http://avicodec.duby.info/, that check which
video/sound codec is needed to play an avi file.
You can test it with the osgmovie example.
"
The patched loader also complains more loudly if a material library file wasn't found or if a referenced material wasn't found in the material library."
makes smoothing optional for verticies which do not have a normal
associated with them in the OBJ input file. The previous behavior was
to always smooth at all verticies which did not have surface normals.
In this new implementation smoothing is on by default to be compatible
with previous behavior. The user can now specify the "generateFacetNormals"
option to the reader to use facet normals for verticies where the OBJ
file does not specify a normal."
Note from Robert Osfield, changed "noSmoothing" naming used by Lee to "generateFacetNormals".
Most notable the __hpux define stuff. The __hpux__ variant seems to be not
defined which resulted in a compile error at this time. Consequently I have
replaced all occurances of __hpux__ with __hpux. And huge surprise: now osg
plugins are found and loaded correctly ...
The next notable one is the MSVC_IDE fix which makes the nmake Makefiles cmake
generator target behave like the ide one. Showed up because I started to do
scripted builds with nmake instead of devenv...
The rest is the usual bunch of stuff that just happens during normal
coding ..."