That doesn’t seem to work in Blender 2.8. I suspect it’s because the render tab now completely changes depending on what render engine you select. I don’t get an error, just no panel.
I suspect I need a different string for bl_context. I’ve tried everything I can think of - “rendercycles, render_cycles etc. etc.”. Nothing seems to work.
It should still work, we use identical code in Blender itself still. The render properties got split into render and output but it should appear in the first still.
Hard to say what might be the problem without more context, maybe the poll function is checking for Blender Internal or something like that.
I tested “render” yesterday and it does still work. Load the “Simple Panel” example and change the bl_context to render.
@brecht is there a way to find all the bl_context options with python? Bl_context options not listed in the API and the only way I know to get those is browse the source code.
At your suggestion, I just did exactly that. Used the Simple Panel example from the Blender 2.8 API reference.
Same problem I have with my add-on. It will only appear in Object or Material. Every other value (“render”, “output” etc.) definitely doesn’t work (for me).
Bit out of my depth, but I assume it wouldn’t be Linux specific?
@brecht@AFWS Screenshot just to provide I am not (completely) insane. I can only post one image as a new user, so I can’t show you that it does work with “object”.
This is using the Simple Panel example from the Blender 2.8 API.
Well, for starters you selected “scene” and not “render” in the Properties. If you tested the Simple Panel example, you will see it adds the “label” ,but not the other properties. I think this is because you might have to have your properties be the same context as the bl_context. I might be completely wrong about this.
@AFWS No, that’s wrong. If you look closely at the screen shot, that’s the render tab in properties not scene (I circled it in Red). You will note that it always says “Scene” at the top, regardless of what tab you are on.
Again, if you look at the screen shot, I am using the Simple Panel example from here, and it defines all of the following (where I have changed bl_context to render as advised):
Yeah, you’re right. I was reading the “Scene” and thinking it wasn’t on the right tab. You can see here it creates a panel ,but doesn’t add anything with “bpy.context.object”. You start of with trying to add properties with "bpy.context.object, so I think this is why you don’t get anything. This is why I’m thinking, you can only draw properties as the same context as the bl_context.
I think I understand your theory, but I can’t quite reconcile it. Especially as I can’t get the Simple Panel example to work (putting my own code aside for a moment).
Can you do me a favour? Can you just copy and paste that exact file somewhere I can get it? Pastebin or something?
easiest way to check things. Hover over the item > right click (with pythin info enabled) > edit
than open a text editor panel and select the *.py file which shows. The first time the highlighter could not show the proper location. So do it another time, than it will scroll in to view. To view it more clear enable those handy new 3 icons. Line numbers, word wrapping, syntax hightlight
As you can see in my example, there is a function added RenderButtonsPanel. Thats simple an easy method to reuse repetitive functions/operators. At least as far as i understand that part
If you scroll to the top or use find, they must add backwards here as well. Search is always forwards and return dialog at the end. It should loop, thats my idea
Anyways …
at the top is the RenderButtonsPanel
The code you used looks the same and should work
My guess your context is wrong. As you are in the render section. Perhaps try obj = context.scene.object instead of obj = context.object
you probably had an error stating Render does not contain blablaala… object
Without the poll it will also show when old object is highlighted in the outliner. Im not 100% sure about that. But a poll is handy when you dont want the function/panel or what to show or execute.