mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
move mayaShader to maya
This commit is contained in:
parent
9cea8f3074
commit
bab8ccf703
@ -19,6 +19,7 @@
|
||||
#include "mayaShader.h"
|
||||
#include "maya_funcs.h"
|
||||
#include "config_maya.h"
|
||||
#include "pset.h"
|
||||
|
||||
#include "pre_maya_include.h"
|
||||
#include <maya/MFnDependencyNode.h>
|
||||
@ -85,7 +86,7 @@ MayaShader(MObject engine) {
|
||||
// transforms indicated by the shader.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LMatrix3d MayaShader::
|
||||
compute_texture_matrix() {
|
||||
compute_texture_matrix() const {
|
||||
LVector2d scale(_repeat_uv[0] / _coverage[0],
|
||||
_repeat_uv[1] / _coverage[1]);
|
||||
LVector2d trans(_offset[0] - _translate_frame[0] / _coverage[0],
|
||||
|
@ -38,7 +38,7 @@ class MayaShader {
|
||||
public:
|
||||
MayaShader(MObject engine);
|
||||
|
||||
LMatrix3d compute_texture_matrix();
|
||||
LMatrix3d compute_texture_matrix() const;
|
||||
|
||||
void output(ostream &out) const;
|
||||
|
||||
|
@ -69,7 +69,6 @@
|
||||
////////////////////////////////////////////////////////////////////
|
||||
MayaToEggConverter::
|
||||
MayaToEggConverter(const string &program_name) :
|
||||
_shaders(this),
|
||||
_program_name(program_name)
|
||||
{
|
||||
_polygon_output = false;
|
||||
@ -84,7 +83,6 @@ MayaToEggConverter(const string &program_name) :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
MayaToEggConverter::
|
||||
MayaToEggConverter(const MayaToEggConverter ©) :
|
||||
_shaders(this),
|
||||
_maya(copy._maya)
|
||||
{
|
||||
}
|
||||
@ -799,7 +797,7 @@ make_nurbs_curve(const MDagPath &, const MFnNurbsCurve &curve,
|
||||
|
||||
MayaShader *shader = _shaders.find_shader_for_node(curve.object());
|
||||
if (shader != (MayaShader *)NULL) {
|
||||
shader->set_attributes(*egg_curve, *this);
|
||||
set_shader_attributes(*egg_curve, *shader);
|
||||
}
|
||||
}
|
||||
|
||||
@ -915,11 +913,11 @@ make_polyset(const MDagPath &dag_path, const MFnMesh &mesh,
|
||||
MayaShader *shader =
|
||||
_shaders.find_shader_for_shading_engine(engine);
|
||||
if (shader != (MayaShader *)NULL) {
|
||||
shader->set_attributes(*egg_poly, *this);
|
||||
set_shader_attributes(*egg_poly, *shader);
|
||||
}
|
||||
|
||||
} else if (default_shader != (MayaShader *)NULL) {
|
||||
default_shader->set_attributes(*egg_poly, *this);
|
||||
set_shader_attributes(*egg_poly, *default_shader);
|
||||
}
|
||||
|
||||
pi.next();
|
||||
@ -995,7 +993,7 @@ set_shader_attributes(EggPrimitive &primitive, const MayaShader &shader) {
|
||||
// if present, replaces the color.
|
||||
|
||||
if (shader._has_texture) {
|
||||
Filename pathname = convert_texture_path(_texture);
|
||||
Filename pathname = convert_texture_path(shader._texture);
|
||||
EggTexture tex(shader._name, pathname);
|
||||
tex.set_wrap_u(shader._wrap_u ? EggTexture::WM_repeat : EggTexture::WM_clamp);
|
||||
tex.set_wrap_v(shader._wrap_v ? EggTexture::WM_repeat : EggTexture::WM_clamp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user