Listing the "Blender Foundation" as copyright holder implied the Blender Foundation holds copyright to files which may include work from many developers. While keeping copyright on headers makes sense for isolated libraries, Blender's own code may be refactored or moved between files in a way that makes the per file copyright holders less meaningful. Copyright references to the "Blender Foundation" have been replaced with "Blender Authors", with the exception of `./extern/` since these this contains libraries which are more isolated, any changed to license headers there can be handled on a case-by-case basis. Some directories in `./intern/` have also been excluded: - `./intern/cycles/` it's own `AUTHORS` file is planned. - `./intern/opensubdiv/`. An "AUTHORS" file has been added, using the chromium projects authors file as a template. Design task: #110784 Ref !110783.
79 lines
2.1 KiB
C++
79 lines
2.1 KiB
C++
/* SPDX-FileCopyrightText: 2011-2022 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup collada
|
|
*/
|
|
|
|
#include "BLI_string.h"
|
|
#include <cstddef>
|
|
|
|
#include "ExtraHandler.h"
|
|
|
|
ExtraHandler::ExtraHandler(DocumentImporter *dimp, AnimationImporter *aimp)
|
|
: currentExtraTags(nullptr)
|
|
{
|
|
this->dimp = dimp;
|
|
this->aimp = aimp;
|
|
}
|
|
|
|
bool ExtraHandler::elementBegin(const char *elementName, const char **attributes)
|
|
{
|
|
/* \todo attribute handling for profile tags */
|
|
currentElement = std::string(elementName);
|
|
// addToSidTree(attributes[0], attributes[1]);
|
|
return true;
|
|
}
|
|
|
|
bool ExtraHandler::elementEnd(const char *elementName)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool ExtraHandler::textData(const char *text, size_t textLength)
|
|
{
|
|
char buf[1024];
|
|
|
|
if (currentElement.length() == 0 || currentExtraTags == nullptr) {
|
|
return false;
|
|
}
|
|
|
|
BLI_strncpy(buf, text, textLength + 1);
|
|
currentExtraTags->addTag(currentElement, std::string(buf));
|
|
return true;
|
|
}
|
|
|
|
bool ExtraHandler::parseElement(const char *profileName,
|
|
const ulong &elementHash,
|
|
const COLLADAFW::UniqueId &uniqueId)
|
|
{
|
|
/* implement for backwards compatibility, new version added object parameter */
|
|
return parseElement(profileName, elementHash, uniqueId, nullptr);
|
|
}
|
|
|
|
bool ExtraHandler::parseElement(const char *profileName,
|
|
const ulong &elementHash,
|
|
const COLLADAFW::UniqueId &uniqueId,
|
|
COLLADAFW::Object *object)
|
|
{
|
|
if (BLI_strcaseeq(profileName, "blender")) {
|
|
#if 0
|
|
printf("In parseElement for supported profile %s for id %s\n",
|
|
profileName,
|
|
uniqueId.toAscii().c_str());
|
|
#endif
|
|
currentUid = uniqueId;
|
|
ExtraTags *et = dimp->getExtraTags(uniqueId);
|
|
if (!et) {
|
|
et = new ExtraTags(std::string(profileName));
|
|
dimp->addExtraTags(uniqueId, et);
|
|
}
|
|
currentExtraTags = et;
|
|
return true;
|
|
}
|
|
// printf("In parseElement for unsupported profile %s for id %s\n", profileName,
|
|
// uniqueId.toAscii().c_str());
|
|
return false;
|
|
}
|