Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Niflib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
Niflib
Commits
8fb0a900
Commit
8fb0a900
authored
13 years ago
by
Alecu100
Browse files
Options
Downloads
Patches
Plain Diff
added overloads for the controller sequence to add generic interpolators
parent
d43b7317
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/obj/NiControllerSequence.h
+13
-2
13 additions, 2 deletions
include/obj/NiControllerSequence.h
src/obj/NiControllerSequence.cpp
+47
-0
47 additions, 0 deletions
src/obj/NiControllerSequence.cpp
with
60 additions
and
2 deletions
include/obj/NiControllerSequence.h
+
13
−
2
View file @
8fb0a900
...
@@ -107,7 +107,7 @@ public:
...
@@ -107,7 +107,7 @@ public:
NIFLIB_API
void
AddController
(
string
const
&
targetName
,
NiTimeController
*
obj
);
NIFLIB_API
void
AddController
(
string
const
&
targetName
,
NiTimeController
*
obj
);
/*!
/*!
* Atta
t
ches an interpolator to this KF file for a KF file of version greater than 10.2.0.0. Versions below this use controllers.
* Attaches an interpolator to this KF file for a KF file of version greater than 10.2.0.0. Versions below this use controllers.
* \param[in] obj A reference to the new controller which has an interpolator to attach.
* \param[in] obj A reference to the new controller which has an interpolator to attach.
* \param[in] priority Used only in Oblivion to set the priority of one controller over another when the two are merged.
* \param[in] priority Used only in Oblivion to set the priority of one controller over another when the two are merged.
* \sa NiControllerSequence::ClearChildren, NiControllerSequence::AddController
* \sa NiControllerSequence::ClearChildren, NiControllerSequence::AddController
...
@@ -115,7 +115,7 @@ public:
...
@@ -115,7 +115,7 @@ public:
NIFLIB_API
void
AddInterpolator
(
NiSingleInterpController
*
obj
,
byte
priority
=
0
);
NIFLIB_API
void
AddInterpolator
(
NiSingleInterpController
*
obj
,
byte
priority
=
0
);
/*!
/*!
* Atta
t
ches an interpolator to this KF file for a KF file of version greater than 10.2.0.0. Versions below this use controllers.
* Attaches an interpolator to this KF file for a KF file of version greater than 10.2.0.0. Versions below this use controllers.
* \param[in] obj A reference to the new controller which has an interpolator to attach.
* \param[in] obj A reference to the new controller which has an interpolator to attach.
* \param[in] priority Used only in Oblivion to set the priority of one controller over another when the two are merged.
* \param[in] priority Used only in Oblivion to set the priority of one controller over another when the two are merged.
* \param[in] include_string_pallete Indicates if the resulting ControllerLinks will hold reference to the NiStringPallete in the NiControllerSequence
* \param[in] include_string_pallete Indicates if the resulting ControllerLinks will hold reference to the NiStringPallete in the NiControllerSequence
...
@@ -123,6 +123,17 @@ public:
...
@@ -123,6 +123,17 @@ public:
*/
*/
NIFLIB_API
void
AddInterpolator
(
NiSingleInterpController
*
obj
,
byte
priority
,
bool
include_string_pallete
);
NIFLIB_API
void
AddInterpolator
(
NiSingleInterpController
*
obj
,
byte
priority
,
bool
include_string_pallete
);
/*!
* Attaches a generic interpolator to this KF file for a KF file of version greater than 10.2.0.0. Versions below this use controllers.
* \param[in] interpolator A reference to the new interpolator to insert into the controllersequence
* \param[in] target The target object that the controller which held the interpolator would act on
* \param[in] controller_type_name The name of the type of the controller that held the interpolator
* \param[in] priority Used only in Oblivion to set the priority of one controller over another when the two are merged.
* \param[in] include_string_pallete Indicates if the resulting ControllerLinks will hold reference to the NiStringPallete in the NiControllerSequence
* \sa NiControllerSequence::ClearChildren, NiControllerSequence::AddController
*/
NIFLIB_API
void
AddGenericInterpolator
(
NiInterpolator
*
interpolator
,
NiObjectNET
*
target
,
string
controller_type_name
,
byte
priority
=
0
,
bool
include_string_pallete
=
true
);
/*!
/*!
* Removes all controllers and interpolators from this Kf file root object.
* Removes all controllers and interpolators from this Kf file root object.
* \sa NiControllerSequence::AddController, NiControllerSequence::AddInterpolator
* \sa NiControllerSequence::AddController, NiControllerSequence::AddInterpolator
...
...
This diff is collapsed.
Click to expand it.
src/obj/NiControllerSequence.cpp
+
47
−
0
View file @
8fb0a900
...
@@ -433,6 +433,53 @@ void NiControllerSequence::AddInterpolator( NiSingleInterpController * obj, byte
...
@@ -433,6 +433,53 @@ void NiControllerSequence::AddInterpolator( NiSingleInterpController * obj, byte
}
}
void
NiControllerSequence
::
AddGenericInterpolator
(
NiInterpolator
*
interpolator
,
NiObjectNET
*
target
,
string
controller_type_name
,
byte
priority
/*= 0*/
,
bool
include_string_pallete
/*= true*/
)
{
//Make sure the parameters aren't null
if
(
interpolator
==
NULL
)
{
throw
runtime_error
(
"Attempted to add a null interpolator to the controller sequence"
);
}
if
(
target
==
NULL
)
{
throw
runtime_error
(
"Attempted to add a null target to the controller sequence"
);
}
//Make a new ControllerLink and fill out necessary data
ControllerLink
cl
;
NiPropertyRef
prop
=
DynamicCast
<
NiProperty
>
(
target
);
cl
.
interpolator
=
interpolator
;
cl
.
priority
=
priority
;
if
(
include_string_pallete
==
true
)
{
//If there are existing ControllerLinks, use the same StringPalette they're using
if
(
stringPalette
==
NULL
)
{
stringPalette
=
new
NiStringPalette
;
}
cl
.
stringPalette
=
stringPalette
;
cl
.
nodeNameOffset
=
stringPalette
->
AddSubStr
(
target
->
GetName
()
);
if
(
prop
!=
NULL
)
{
cl
.
propertyTypeOffset
=
stringPalette
->
AddSubStr
(
prop
->
GetType
().
GetTypeName
()
);
}
cl
.
controllerTypeOffset
=
stringPalette
->
AddSubStr
(
controller_type_name
);
}
else
{
cl
.
stringPalette
=
NULL
;
cl
.
nodeName
=
target
->
GetName
();
if
(
prop
!=
NULL
)
{
cl
.
propertyType
=
prop
->
GetType
().
GetTypeName
();
}
cl
.
controllerType
=
controller_type_name
;
}
//Add finished ControllerLink to list
controlledBlocks
.
push_back
(
cl
);
}
void
NiControllerSequence
::
ClearControllerData
()
{
void
NiControllerSequence
::
ClearControllerData
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment