mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
better handling for non-blending case
This commit is contained in:
parent
9e9e1eeef7
commit
0a0bf8e38f
@ -77,23 +77,32 @@ get_blend_value(const PartBundle *root) {
|
|||||||
_value = _initial_value;
|
_value = _initial_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (cdata->_blend.size() == 1 && !cdata->_frame_blend_flag) {
|
} else if ((cdata->_blend.size() == 1 || !cdata->_anim_blend_flag) &&
|
||||||
|
!cdata->_frame_blend_flag) {
|
||||||
// A single value, the normal case.
|
// A single value, the normal case.
|
||||||
AnimControl *control = (*cdata->_blend.begin()).first;
|
AnimControl *bound_control = NULL;
|
||||||
|
ChannelType *bound_channel = NULL;
|
||||||
|
|
||||||
ChannelType *channel = NULL;
|
PartBundle::ChannelBlend::const_iterator cbi;
|
||||||
|
for (cbi = cdata->_blend.begin();
|
||||||
|
cbi != cdata->_blend.end() && bound_channel == (ChannelType *)NULL;
|
||||||
|
++cbi) {
|
||||||
|
AnimControl *control = (*cbi).first;
|
||||||
int channel_index = control->get_channel_index();
|
int channel_index = control->get_channel_index();
|
||||||
if (channel_index >= 0 && channel_index < (int)_channels.size()) {
|
if (channel_index >= 0 && channel_index < (int)_channels.size()) {
|
||||||
channel = DCAST(ChannelType, _channels[channel_index]);
|
bound_control = control;
|
||||||
|
bound_channel = DCAST(ChannelType, _channels[channel_index]);
|
||||||
}
|
}
|
||||||
if (channel == (ChannelType *)NULL) {
|
}
|
||||||
|
|
||||||
|
if (bound_channel == (ChannelType *)NULL) {
|
||||||
// Nothing is actually bound here.
|
// Nothing is actually bound here.
|
||||||
if (restore_initial_pose) {
|
if (restore_initial_pose) {
|
||||||
_value = _initial_value;
|
_value = _initial_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
channel->get_value(control->get_frame(), _value);
|
bound_channel->get_value(bound_control->get_frame(), _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -62,23 +62,32 @@ get_blend_value(const PartBundle *root) {
|
|||||||
_value = _initial_value;
|
_value = _initial_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (cdata->_blend.size() == 1 && !cdata->_frame_blend_flag) {
|
} else if ((cdata->_blend.size() == 1 || !cdata->_anim_blend_flag) &&
|
||||||
|
!cdata->_frame_blend_flag) {
|
||||||
// A single value, the normal case.
|
// A single value, the normal case.
|
||||||
AnimControl *control = (*cdata->_blend.begin()).first;
|
AnimControl *bound_control = NULL;
|
||||||
|
ChannelType *bound_channel = NULL;
|
||||||
|
|
||||||
ChannelType *channel = NULL;
|
PartBundle::ChannelBlend::const_iterator cbi;
|
||||||
|
for (cbi = cdata->_blend.begin();
|
||||||
|
cbi != cdata->_blend.end() && bound_channel == (ChannelType *)NULL;
|
||||||
|
++cbi) {
|
||||||
|
AnimControl *control = (*cbi).first;
|
||||||
int channel_index = control->get_channel_index();
|
int channel_index = control->get_channel_index();
|
||||||
if (channel_index >= 0 && channel_index < (int)_channels.size()) {
|
if (channel_index >= 0 && channel_index < (int)_channels.size()) {
|
||||||
channel = DCAST(ChannelType, _channels[channel_index]);
|
bound_control = control;
|
||||||
|
bound_channel = DCAST(ChannelType, _channels[channel_index]);
|
||||||
}
|
}
|
||||||
if (channel == NULL) {
|
}
|
||||||
|
|
||||||
|
if (bound_channel == NULL) {
|
||||||
// Nothing is actually bound here.
|
// Nothing is actually bound here.
|
||||||
if (restore_initial_pose) {
|
if (restore_initial_pose) {
|
||||||
_value = _initial_value;
|
_value = _initial_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
channel->get_value(control->get_frame(), _value);
|
bound_channel->get_value(bound_control->get_frame(), _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user