IronPython:构建 WPF ShaderEffect 时遇到问题
我正在尝试构建一个可扩展的程序,用户可以在其中构建自己的着色器效果。
谷歌搜索让我走到了这一步;
class Test(ShaderEffect):
inputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", type(Test()), 0)
但我仍然收到错误;
类型错误:无法访问受保护的 成员 注册PixelShaderSampler属性 没有 python 子类 着色器效果。
任何帮助将不胜感激。
我可以找到网上最好的来源 链接在这里
I'm trying to build an extensible program where users, among other things, can build their own shader effects.
Google searching got me this far;
class Test(ShaderEffect):
inputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", type(Test()), 0)
But I still get the error;
TypeError: cannot access protected
member
RegisterPixelShaderSamplerProperty
without a python subclass of
ShaderEffect.
Any help would be greatly appreciated.
The best source on the net I could find is linked here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将需要使用反射来访问 .NET 类的受保护成员 - 您没有可以直接访问此类成员的 Python 子类。
尝试这样的想法(我还没有测试过):
You will need to use Reflection to access protected memeber of .NET class - you don't have a Python subclass where you can access such member directly.
Try somethink like this (I have't tested it):