OGRE ANIMATION

Ogre中实现动画效果之节点动画(Node Animation) Ogre中与节点动画相关的类: (1)Ogre::Animation (2)Ogre::AnimationState (3)Ogre::NodeAnimationTrack (4)Ogre::TransformKeyFrame 节点动画的使用步骤: //1.创建动画对象 Animation* anim= mSceneMgr->create 阅读详情

一 OGRE支持的四种动画

Ogre默认支持四种形式的动画:1.骨骼动画 2.节点动画 3.顶点动画 4.数值动画

其中骨骼动画也是节点动画,因为bone继承于node

 

1.骨骼动画 :

骨骼动画的基础:在ogre中骨骼动画主要涉及两个类,mesh和skeleton,skeleton由许多Bone组成,这些bone之间有层级关系,skeleton就是一个骨架关系,某个mesh可以被绑定在这个skeleton上,绑定的实质就是某个vertex受某些bone的影响,也就是某个bone运动,就会导致和他有关系的那些vertex运动。所以对照本页最上面的图,他最末端控制的店就是skeleton中的每个bone,一个skeleton中可以蕴含多套animation。

一般情况下骨骼动画都是在maya或3Dmax之类的工具里面制作好的,然后通过导出方式,导出到一个mesh文件和一个skeleton文件。ogre在加载模型的时候已经把这些动画加载好,需要直接使用就行了。

 

AnimationState* as=entity->getAnimationState("动画名字");

动态创作骨骼动画:在另外一些情况下,我们只是在skeleton文件中设置网格顶点与骨骼的绑定关系,而不描述骨骼的运动轨迹。运动轨迹会动态的根据实际情况生成,这对于物理碰撞检测后的动画效果是很常见的。

 
//1.把skeleton和mesh文件内容加载到entity,此时绑定了骨骼与顶点但是没有实现动画效果...

//获取entity中的相应骨骼
SkeletonInstance* ske=entiy->getSkeleton();
//为骨骼添加一个动画
Animation* anim=ske->createAnimation("My",1);
//为每一块骨头创建track(动作集)
Bone* b0=ske->getRootBone(); 
NodeAnimationTrack* t0=anim->createNodeTrack(0,b0);//例如这是为root bone创建
//为每个bone的track创建关键帧...

//更新这个新加入的动画
entity->refreshAvailableAnimationState();

2.场景节点动画:

是指让场景中的某些结点运动,如创建camera的动画等。

 
// 创建Animation
Animation* anim=smgr->createAnimation(); 
// 设置插值方式:线性的和样条线(样条线的更加平滑)
anim->setInterpolationMode(Animation::IM_SPLINE);
//为需要动画的节点创建一个Track,节点动画是以节点为单位
NodeAnimationTrack* t0=anim->createNodeTrack(0,node);
//对于每个track创建它的每个关键帧
TransformKeyFrame* k_t0_0=t0->createNodeKeyFrame(0);//设置该帧的时间点 
k_t0_0->setTranslate(Ogre::Vector3(0,0,0));//设置该帧处这个结点的位置和其他几何状态 
TransformKeyFrame* k_t0_1=t0->createNodeKeyFrame(1); 
k_t0_1->setTranslate(Ogre::Vector3(100,0,0));

//创建一个AnimationState用于控制动画
AnimationState* as=smgr->createAnimationState(该动画名字);
as->setEnabled(true); //必须设置为true才能被播放

as->setTimePosition();//在帧监听中通过调用这个函数来播放动画

3.顶点动画:

顶点动画大多情况下利用gpu shader来实现以提高效率,所以较少直接使用ogre的动画机制。

4.数值动画:我的理解是跟传统的一副一副图片组成的动画类似,这种方式效率低下,游戏肯定是不会用到的。

 

二 详解Animation AnimationTrack AnimationStates AnimationStateSet KeyFrame

在说API之前先了解一下动画的原理:以一个人行走为例,要想使人能够行走,必须在这个人模型上设置一些特真点,然后让这些点在每一帧按照一定的规则进行动,从而改变整个模型的状态。

在ogre里面,Keyframe类描述的是一个特征点(一个结点、一根骨头、一个顶点)的某一个关键帧的状态(位置、缩放、朝向等)和对应的时间点。

一个可驱动点的所有keyframe组合成一个track,每个可驱动点都有一个他的track,这就好比某个点在整段动画中的轨迹,其中keyframe要由track来创建。

多个track组合在一起就成为了一段动画,用Animation类来表示,这就是一个动画,例如对于骨骼动画,他的每一个骨头都有一个track,那么所有的骨头的track的组合在一起也就是整个骨骼动画了。track由Animation来创建。Animation则可以通过skeleton或者scenenmanager等来创建。

AnimationSate类:通常我们操控一段动画的播放等都不是直接操纵animation

 类,而是通过一个类AnimationState,它是animation的一个实例,通过场景管理器创建某个animation的一个animationState,然后就可以利用这个animationstate来播放这个animation了。

 

AnimationState :这个来描述了一些动画的状态,用于控制动画的播放。

 

BoneBlendMask* mBlendMask;   // ???
String mAnimationName; //Animation名字
AnimationStateSet* mParent; // AnimationState 的管理类
Real mTimePos; // 时间点
Real mLength;  // 时间长度
Real mWeight;  // 骨骼的权重
bool mEnabled; // 是否播放
bool mLoop;   // 是否循环播放

 AnimationState只是控制动画的状态,其并不具备播放功能。另外,AnimationStateSet作为一个容器,不仅存储着AnimationState 而且维护着AnimationState 的状态变更,一旦AnimationState 的某个属性值被改变,AnimationStateSet维护的状态就会变脏。

 

 

Animation :

 

1.插值模式:

 
enum InterpolationMode{ // 插值状态
       IM_LINEAR,  // 线性插值
       IM_SPLINE   // 样条插值(较好)
};
enum RotationInterpolationMode{ //现状插值状态
       RIM_LINEAR,  // 线性插值
       RIM_SPHERICAL // 样条插值
};

2.三种track:

ogre实现了四种动画(1.骨骼动画 2.场景节点动画 3.顶点动画 4.数值动画),在Animation类里面管理了三种track(NumericAnimationTrack,NodeAnimationTrack,VertexAnimationTrack)他们继承于AnimationTrack。

 
NodeTrackList mNodeTrackList; // 一个<unsigned short,NodeAnimationTrack*>map
NumericTrackList mNumericTrackList; // 一个<unsigned short,NumericAnimationTrack*>
VertexTrackList mVertexTrackList; // 一个<unsigned short,VertexAnimationTrack*>
3.播放动画:
动画播放主要用到的方法是:apply,这个方法有好几个重载的方法,其中一个是播放所有的动画,其它的几个都是播放某个节点的方法。
  
//播放所有动画
void Animation::apply(Real timePos, Real weight, Real scale)
    {
		_applyBaseKeyFrame();

        // Calculate time index for fast keyframe search
        TimeIndex timeIndex = _getTimeIndex(timePos);

        NodeTrackList::iterator i;
        for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
        {
            i->second->apply(timeIndex, weight, scale);
        }
		NumericTrackList::iterator j;
		for (j = mNumericTrackList.begin(); j != mNumericTrackList.end(); ++j)
		{
			j->second->apply(timeIndex, weight, scale);
		}
		VertexTrackList::iterator k;
		for (k = mVertexTrackList.begin(); k != mVertexTrackList.end(); ++k)
		{
			k->second->apply(timeIndex, weight, scale);
		}

    }

//播放当前Skeleton的动画
void Animation::apply(Skeleton* skel, Real timePos, float weight,
      const AnimationState::BoneBlendMask* blendMask, Real scale)
    {
		_applyBaseKeyFrame();

		// Calculate time index for fast keyframe search
      TimeIndex timeIndex = _getTimeIndex(timePos);

      NodeTrackList::iterator i;
      for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
      {
        // get bone to apply to 
        Bone* b = skel->getBone(i->first);
		i->second->applyToNode(b, timeIndex, (*blendMask)[b->getHandle()] * weight, scale);
      }
    }
 

AnimationTrack :动画轨迹

 
KeyFrameList mKeyFrames;
KeyFrameIndexMap mKeyFrameIndexMap;

AnimationTrack 除了管理KeyFrame以外,还有几个有用的方法,只不过现在不了解,就先不贴出来分析了。

1.NumericAnimationTrack:

 

void NumericAnimationTrack::applyToAnimable(const AnimableValuePtr& anim, const TimeIndex& timeIndex,
		Real weight, Real scale)
	{
		// Nothing to do if no keyframes or zero weight, scale
		if (mKeyFrames.empty() || !weight || !scale)
			return;

		NumericKeyFrame kf(0, timeIndex.getTimePos());
		getInterpolatedKeyFrame(timeIndex, &kf);
		// add to existing. Weights are not relative, but treated as
		// absolute multipliers for the animation
		AnyNumeric val = kf.getValue() * (weight * scale);

		anim->applyDeltaValue(val);

	}

最终动画是由AnimableValue对象播放的。但是,我看了一下AnimableValue的applyDeltaValue方法,都没有被实现,只是抛了一个异常,这是否意味着我们在使用的时候需要自己实现一个AnimableValue类,由于这种动画并不是需要重点关注的,暂时不往下继续了。

2.VertexAnimationTrack :顶点动画:

 
enum VertexAnimationType  // 顶点动画类型
{
	VAT_NONE = 0,    // 没有动画
	VAT_MORPH = 1,  // 形变动画
	VAT_POSE = 2     // 姿态动画
};

 顶点的轨迹可能有两种产生方式,所以在播放的时候也有两种方式:

 
void VertexAnimationTrack::applyToVertexData(VertexData* data,
		const TimeIndex& timeIndex, Real weight, const PoseList* poseList)
	{
		// Nothing to do if no keyframes or no vertex data
		if (mKeyFrames.empty() || !data)
			return;

		// Get keyframes
		KeyFrame *kf1, *kf2;
		Real t = getKeyFramesAtTime(timeIndex, &kf1, &kf2);

		if (mAnimationType == VAT_MORPH)
		{
			VertexMorphKeyFrame* vkf1 = static_cast<VertexMorphKeyFrame*>(kf1);
			VertexMorphKeyFrame* vkf2 = static_cast<VertexMorphKeyFrame*>(kf2);

			if (mTargetMode == TM_HARDWARE)
			{
				// If target mode is hardware, need to bind our 2 keyframe buffers,
				// one to main pos, one to morph target texcoord
				assert(!data->hwAnimationDataList.empty() &&
					"Haven't set up hardware vertex animation elements!");

				// no use for TempBlendedBufferInfo here btw
				// NB we assume that position buffer is unshared, except for normals
				// VertexDeclaration::getAutoOrganisedDeclaration should see to that
				const VertexElement* posElem =
					data->vertexDeclaration->findElementBySemantic(VES_POSITION);
				// Set keyframe1 data as original position
				data->vertexBufferBinding->setBinding(
					posElem->getSource(), vkf1->getVertexBuffer());
				// Set keyframe2 data as derived
				data->vertexBufferBinding->setBinding(
					data->hwAnimationDataList[0].targetBufferIndex,
					vkf2->getVertexBuffer());
				// save T for use later
				data->hwAnimationDataList[0].parametric = t;

			}
			else
			{
				// If target mode is software, need to software interpolate each vertex

				Mesh::softwareVertexMorph(
					t, vkf1->getVertexBuffer(), vkf2->getVertexBuffer(), data);
			}
		}
		else
		{
			// Pose

			VertexPoseKeyFrame* vkf1 = static_cast<VertexPoseKeyFrame*>(kf1);
			VertexPoseKeyFrame* vkf2 = static_cast<VertexPoseKeyFrame*>(kf2);

			// For each pose reference in key 1, we need to locate the entry in
			// key 2 and interpolate the influence
			const VertexPoseKeyFrame::PoseRefList& poseList1 = vkf1->getPoseReferences();
			const VertexPoseKeyFrame::PoseRefList& poseList2 = vkf2->getPoseReferences();
			for (VertexPoseKeyFrame::PoseRefList::const_iterator p1 = poseList1.begin();
				p1 != poseList1.end(); ++p1)
			{
				Real startInfluence = p1->influence;
				Real endInfluence = 0;
				// Search for entry in keyframe 2 list (if not there, will be 0)
				for (VertexPoseKeyFrame::PoseRefList::const_iterator p2 = poseList2.begin();
					p2 != poseList2.end(); ++p2)
				{
					if (p1->poseIndex == p2->poseIndex)
					{
						endInfluence = p2->influence;
						break;
					}
				}
				// Interpolate influence
				Real influence = startInfluence + t*(endInfluence - startInfluence);
				// Scale by animation weight
				influence = weight * influence;
				// Get pose
				assert (p1->poseIndex < poseList->size());
				Pose* pose = (*poseList)[p1->poseIndex];
				// apply
				applyPoseToVertexData(pose, data, influence);
			}
			// Now deal with any poses in key 2 which are not in key 1
			for (VertexPoseKeyFrame::PoseRefList::const_iterator p2 = poseList2.begin();
				p2 != poseList2.end(); ++p2)
			{
				bool found = false;
				for (VertexPoseKeyFrame::PoseRefList::const_iterator p1 = poseList1.begin();
					p1 != poseList1.end(); ++p1)
				{
					if (p1->poseIndex == p2->poseIndex)
					{
						found = true;
						break;
					}
				}
				if (!found)
				{
					// Need to apply this pose too, scaled from 0 start
					Real influence = t * p2->influence;
					// Scale by animation weight
					influence = weight * influence;
					// Get pose
					assert (p2->poseIndex <= poseList->size());
					const Pose* pose = (*poseList)[p2->poseIndex];
					// apply
					applyPoseToVertexData(pose, data, influence);
				}
			} // key 2 iteration
		} // morph or pose animation
	}

3.NodeAnimationTrack :

 

void NodeAnimationTrack::applyToNode(Node* node, const TimeIndex& timeIndex, Real weight,
		Real scl)
    {
		// Nothing to do if no keyframes or zero weight or no node
		if (mKeyFrames.empty() || !weight || !node)
			return;

        TransformKeyFrame kf(0, timeIndex.getTimePos());
		getInterpolatedKeyFrame(timeIndex, &kf);

		// add to existing. Weights are not relative, but treated as absolute multipliers for the animation
        Vector3 translate = kf.getTranslate() * weight * scl;
		node->translate(translate);

		// interpolate between no-rotation and full rotation, to point 'weight', so 0 = no rotate, 1 = full
        Quaternion rotate;
        Animation::RotationInterpolationMode rim =
            mParent->getRotationInterpolationMode();
        if (rim == Animation::RIM_LINEAR)
        {
            rotate = Quaternion::nlerp(weight, Quaternion::IDENTITY, kf.getRotation(), mUseShortestRotationPath);
        }
        else //if (rim == Animation::RIM_SPHERICAL)
        {
            rotate = Quaternion::Slerp(weight, Quaternion::IDENTITY, kf.getRotation(), mUseShortestRotationPath);
        }
		node->rotate(rotate);

		Vector3 scale = kf.getScale();
		// Not sure how to modify scale for cumulative anims... leave it alone
		//scale = ((Vector3::UNIT_SCALE - kf.getScale()) * weight) + Vector3::UNIT_SCALE;
		if (scale != Vector3::UNIT_SCALE)
		{
            if (scl != 1.0f)
                scale = Vector3::UNIT_SCALE + (scale - Vector3::UNIT_SCALE) * scl;
            else if (weight != 1.0f)
                scale = Vector3::UNIT_SCALE + (scale - Vector3::UNIT_SCALE) * weight;
		}
		node->scale(scale);

    }
 

KeyFrame :KeyFrame 的内容比较简单,所有关键的东西都在Track里面处理了

 
NumericKeyFrame          // KeyFrame
TransformKeyFrame       // KeyFrame
VertexMorphKeyFrame  //  形变动画的KeyFrame
VertexPoseKeyFrame    //  姿态动画的KeyFrame

总结:对于整个ogre的动画体系来说,Animation 是动画的管理类,而AnimationState 是动画状态的控制类。Animation 的动画播放其实是调用其相应的track类来播放的,KeyFrame 更多的是起到数据单元的作用。所以,完全弄清楚四种动画的底层实现,重点需要关注的是track类,这里没有写多少因为我自己也不太清楚,后面在写例子的时候,再从使用者的角度详细描述一下ogre的动画的底部执行过程。

 

三 SceneManager 对动画的管理及播放:

1.动画对象的管理:

AnimationList mAnimationsList;
AnimationStateSet mAnimationStates;

Animation* SceneManager::createAnimation(const String& name, Real length)
{
	OGRE_LOCK_MUTEX(mAnimationsListMutex)
    if (mAnimationsList.find(name) != mAnimationsList.end())
    {
        OGRE_EXCEPT(
            Exception::ERR_DUPLICATE_ITEM,
            "An animation with the name " + name + " already exists",
            "SceneManager::createAnimation" );
    }
    Animation* pAnim = OGRE_NEW Animation(name, length);
    mAnimationsList[name] = pAnim;
    return pAnim;
}

AnimationState* SceneManager::createAnimationState(const String& animName)
{
        Animation* anim = getAnimation(animName);//如果不存在就会抛异常
	return mAnimationStates.createAnimationState(animName, 0, anim->getLength());
}

在SceneManager里面使用Animation时会把Animation保存在mAnimationsList里面,AnimationState保存在mAnimationStates里面,他们通过animName来保持一一对应。生命周期:Animation创建-->AnimationState创建-->AnimationState销毁-->Animation销毁。如果不是按照这种顺序会报异常。

 

2.动画播放:

void SceneManager::_applySceneAnimations(void)
{
	// manual lock over states (extended duration required)
	OGRE_LOCK_MUTEX(mAnimationStates.OGRE_AUTO_MUTEX_NAME)

	// Iterate twice, once to reset, once to apply, to allow blending
    ConstEnabledAnimationStateIterator stateIt = mAnimationStates.getEnabledAnimationStateIterator();

    while (stateIt.hasMoreElements())
    {
        const AnimationState* state = stateIt.getNext();
        Animation* anim = getAnimation(state->getAnimationName());

        // Reset any nodes involved
        Animation::NodeTrackIterator nodeTrackIt = anim->getNodeTrackIterator();
        while(nodeTrackIt.hasMoreElements())
        {
            Node* nd = nodeTrackIt.getNext()->getAssociatedNode();
			if (nd)
				nd->resetToInitialState();
        }

        Animation::NumericTrackIterator numTrackIt = anim->getNumericTrackIterator();
        while(numTrackIt.hasMoreElements())
        {
            const AnimableValuePtr& animPtr = numTrackIt.getNext()->getAssociatedAnimable();
			if (!animPtr.isNull())
				animPtr->resetToBaseValue();
        }
    }

	// this should allow blended animations
	stateIt = mAnimationStates.getEnabledAnimationStateIterator();
	while (stateIt.hasMoreElements())
	{
		const AnimationState* state = stateIt.getNext();
		Animation* anim = getAnimation(state->getAnimationName());
		// Apply the animation
		anim->apply(state->getTimePosition(), state->getWeight());
	}
}

 遍历所有Enabled为true的动画状态,调用node的resetToInitialState()和AnimableValue的resetToBaseValue()方法,分辨对节点动画和数组动画进行reset,最后调用Animation的apply方法进行播放动画。

 

OGRE 动画源码解析及动画创建步骤 学习ogre非常好的资料,本人从网上搜集下来,特贡献出来供大家分享,此文章对我的学习帮助很大,希望对大家有所帮助. 立即下载

相关推荐

【卫星语音通信】神经网络语音编解码算法:AudioDec

最新研究表明,通过深度学习模型对语音信号进行智能压缩与重建,可在12 kbps码率下实现48 kHz采样率的高保真语音还原,其主观音质评分(MOS)可达3.9分(满分4.27分),远超传统参数编码技术。这意味着未来卫星电话的通话质量有望达到CD级水准,而蜂窝网络的语音业务带宽需求可降低60%以上,为蜂窝和卫星网络中的大规模物联网语音交互铺平道路。它的诞生为神经音频编解码技术带来了一次重要升级,有助于让未来实时语音交互更流畅、更清晰,也让我们进一步体验到人工智能与音频信号处理结合所带来的创新可能性。

u011376987的博客 1478

Ogre:Animation(Ogre中的动画)

转载自:http://blog.csdn.net/leonwei/article/details/5819248在Ogre中Animation是一块非常重要的部分,但是笔者在学习Ogre的动画时遗憾的发现关于Ogre中动画的资料非常的少,Ogre的sample中只有最简单的导入一个骨骼动画的例子,在网上也很少有人谈及,Ogre Wiki中的教程也是边边角角,不知这么重要的部分为什么不做一个全面的tu

善战者无赫赫之功 的专栏 1235

CA(载波聚合)

文章目录CA基本概念1. CA分类2. Pcell、Scell以及Serving CellPcell(Primary Cell)Scell(Secondary Cell)3. Pcell、Scell部署场景场景1场景2场景3场景44. CA的协议控制4.1 Camping/Connetion Establishment:4.2 CC Management/SCell Addition/Release:4.3 Handover/Measurements:4.4 SCell激活 CA基本概念 CA也就是我们中文

你又来看我了,一起学习吧 4万+

OGRE 动画

动画         动画是由若干静态画面,快速交替显示而成。因为人的眼睛会产生视角暂留,对上一个画面的感知还未消失。 计算机图形学也遵循这一本质。        OGRE本身不能了解场景中动画角色动作,不知道什么是抬手或走路,只能简单 从数学角度处理定点的位移和旋转。 OGRE动画类型        骨骼动画:用骨骼结构来定义网格数据。        顶点动画:保存顶点的快照来决定

luyuncsd123的专栏 880

保姆级教程:从 TLE 数据源获取到 Cesium 卫星轨迹可视化全流程(含常见报错排查)

本文提供从TLE数据源获取到Cesium卫星轨迹可视化的全流程保姆级教程,涵盖数据预处理、satellite.js计算、Cesium集成及性能优化等关键步骤,并针对常见报错提供详细排查方案,帮助开发者高效实现卫星轨迹可视化。

weixin_29002595的博客 300

3D高斯泼溅实战:如何用自采数据集训练出高质量3D模型(附COLMAP避坑指南)

本文详细介绍了使用自采数据集训练高质量3D高斯泼溅模型的完整实战流程。从数据采集规范、COLMAP稀疏重建的深度配置与避坑指南,到数据格式转换及3DGS训练调优策略,提供了针对自采数据的关键参数调整与问题排查方案,帮助读者高效构建专属3D场景。

g9h0i1的博客 984

Ogre 学习笔记之 OGRE轨迹动画

<br /> <br /> <br />Ogre 学习笔记之 OGRE轨迹动画<br /> <br /> <br />转致:http://www.cppblog.com/yuanyajie/archive/2007/03/02/19132.html<br /> <br /> <br /> <br /><br />轨迹动画(Animation Track),是 OGRE 所支持的几种动画模式(包括骨骼动画)中的一种。通过让节点(node)沿着一条预设了关键帧(Key Frame)的轨迹移动来实现节点的动画。

1115

【Claude】SSL certificate verification 错误:证书校验失败与自定义 CA 配置

获取并验证企业 CA 证书后,需要配置 Claude Code(Node.js)信任该证书。Claude Code 的 SSL 错误通常源于企业代理:不是 Anthropic 服务器的问题Node.js 使用独立的 CA 存储:操作系统信任了企业 CA 不等于 Node.js 也信任NODE_EXTRA_CA_CERTS 是标准解决方案:指向包含企业 CA 的 PEM 文件绝不使用 NODE_TLS_REJECT_UNAUTHORIZED=0:这等于关闭所有 HTTPS 安全验证证书链完整性很重要。

博客 6865

ogre 节点动画中的Ogre::Animation::setInterpolationMode函数

最近做了很多的OGRE节点动画,有一个函数一直是知道,不过没在意。 今天加新功能,有一个bug。 让某物体按照指定路线前进,但是物体像一个醉酒的人一样,按照指定路线走凌波微步。 排除了N多可能。最后,只剩下这个新写的类了。 看着这个运行路线,我突然想到这个路径很想非线性差值的结果。 但是,都是线性的啊,谁也不会弄个非线性的出来,一查代码,还真是非线性的…… 出错函数如下: (Ogre:

jean7155的专栏 1586

中兴交换机如何配置?有哪些常用的配置命令,本文值得收藏!

中兴交换机是一种常见的网络设备,用于构建和管理企业网络。它提供了丰富的功能和灵活的配置选项,使网络管理员能够根据特定需求进行定制化配置。本文将详细介绍中兴交换机的配置过程,包括登录、基本设置、VLAN配置、接口配置和安全配置等内容。

网络技术联盟站 1万+

[Python] -项目实战10- 用 Python 自动化批量重命名文件

本文介绍了使用Python实现文件批量重命名的技术方法。主要内容包括:1)使用os和pathlib模块进行基础文件操作;2)提供多种实用脚本示例,如添加序号、替换字符、添加时间戳等;3)进阶功能包括用户输入和错误处理;4)GUI工具实现方案;5)常见问题与优化建议。文章详细讲解了从简单到复杂的批量重命名实现方法,帮助读者快速掌握这一提高工作效率的技能。建议开发者注意路径处理、错误管理等细节,确保脚本稳健运行。

每日出拳老爷子的博客 816

Ogre::Animation(Ogre中的动画)

http://blog.csdn.net/leonwei/article/details/5819248   在Ogre中Animation是一块非常重要的部分,但是笔者在学习Ogre的动画时遗憾的发现关于Ogre中动画的资料非常的少,Ogre的sample中只有最简单的导入一个骨骼动画的例子,在网上也很少有人谈及,Ogre Wiki中的教程也是边边角角,不知这么重要的部分为什么不做一个全面的

不积硅步,无以至千里;不积小流,无以成江海 837

PCL 改进快速欧式聚类【2025最新版】

在FEC: Fast Euclidean Clustering for Point Cloud Segmentation一文的基础上对算法进行改进。博客长期更新,本文最近更新时间为:2025年9月16日。

点云侠的博客 2570

[ogre]ogre::Animation

参考:http://blog.csdn.net/leonwei/article/details/5819248  http://blog.csdn.net/debugconsole/article/details/32721901   在Ogre中Animation是一块非常重要的部分,但是笔者在学习Ogre的动画时遗憾的发现关于Ogre中动画的资料非常的少,Ogre的sample中只有最简...

weixin_34308389的博客 110

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

ogre Animation Track

轨迹动画(Animation Track),是 OGRE 所支持的几种动画模式(包括骨骼动画)中的一种。通过让节点(node)沿着一条预设了关键帧(Key Frame)的轨迹移动来实现节点的动画。 OGRE 中创建和实施轨迹动画的步骤大致如下: 1. 在主程序类的 Application :: createScene ( ) 场景创建方法中进行以下工作: Animation * O...

anfu8346的博客 180

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

OGRE的Animation相关类

  KeyFrame KeyFrame是基类,有四个子类,NumericKeyFrame,TransformKeyFrame,VertexMorphKeyFrame, VertexPoseKeyFrame. KeyFrame:关键帧,基类 class_OgreExportKeyFrame : publicAnimationAlloc     {     public:   ...

qq_35657267的博客 378

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

XSI Vertex Animation and OGRE Facial Animation

目前OGRE只有XSI 5.x、Maya的导出器及oFusion Pro for 3ds max(收费)支持顶点动画的导出,而在众多建模软件中XSI(http://www.softimage.com/)以其对变形动画的支持最为突出,OGRE提供的Facial Demo中使用的Dr. Bunsen的头就是XSI中提供的一个示例动画,该模型就是使用对顶点簇(cluster)的位置改变来产生动画。

痞子龙3D编程 1665

Ogre3d:OGRE中的Animation动画基础

OGRE中调用模型预先设定好的动画并不是非常困难。当然,是说这部分工作是交给建模人员的前提下。         创建动画的代码相当简单。如下即可: 头文件加上: AnimationState* mAnimState;//实例动画状态对象

栾继阳's 1368
上一篇: 几款游戏引擎技术对比
下一篇: Alpha混合物体的深度排序
凭谁问
博客等级 码龄15年 178粉丝 16原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址