Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with the package nodeitems_utils.py script #260

Closed
philstopford opened this issue Jan 4, 2019 · 13 comments
Closed

Issues with the package nodeitems_utils.py script #260

philstopford opened this issue Jan 4, 2019 · 13 comments

Comments

@philstopford
Copy link

Trying to use SceneCity with this version of blender, I get errors in the console of the form :

location: :-1
Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.79 (With V-Ray Additions)\2.79\scripts\modules\nodeitems_utils.py", line 131, in draw_node_menu_item
for i,item in enumerate(sorted(self.category.items(context), key=lambda t: getattr(bpy.types, t.nodetype).bl_rna.name)):
File "C:\Program Files\Chaos Group\Blender 2.79 (With V-Ray Additions)\2.79\scripts\modules\nodeitems_utils.py", line 131, in
for i,item in enumerate(sorted(self.category.items(context), key=lambda t: getattr(bpy.types, t.nodetype).bl_rna.name)):
AttributeError: 'RNA_Types' object has no attribute 'StaticRoadPortionNode'

and none of the addons entries in its menus are available in the node editor. Nightly builds and 2.79b are fine, so this looks to be specific to the V-ray blender build corresponding to the 5fdbde0 release

@philstopford
Copy link
Author

It seems to be related to the icon code in this script. The attached works better.
nodeitems_utils.py.txt

@philstopford
Copy link
Author

This is still broken. Could you consider checking whether there's something funky in your branch?

@philstopford
Copy link
Author

I felt the need to bump this.

@poseidon4o
Copy link
Collaborator

@philstopford How do you reproduce this? I can import .obj files without errors.

@philstopford
Copy link
Author

philstopford commented Mar 19, 2019

This does seem to be working in 706cd8b. It wasn't working for me in 999e565 or earlier. I was testing with basic objects exported to OBJ from various other packages, that all could import them - just blender/Vray was failing.

@philstopford
Copy link
Author

philstopford commented Mar 19, 2019

Actually, the OBJ comments should go to #261 and I closed that ticket a while back.

The problem with the nodeitems_utils.py script remains - SceneCity is broken with blender/V-ray port.

@philstopford
Copy link
Author

To recap the changes in this patched script, which I tested with the 706cd8b install :

def draw_node_menu_item(self, context):
    layout = self.layout.row()
    col = layout.column()
    for item in self.category.items(context):
        item.draw(item, col, context)
    # Original block below simply doesn't work with SceneCity
    '''
    for i,item in enumerate(sorted(self.category.items(context), key=lambda t: getattr(bpy.types, t.nodetype).bl_rna.name)):
        if self.category.split_items is not None:
            if i and i % self.category.split_items == 0:
                col = layout.column()
        item.draw(item, col, context)
    '''

and then there is a built-in assumption that icons exist in the item draw code, which seems to react better with a try/except :

def draw(self, layout, context):
    default_context = bpy.app.translations.contexts.default
    try:
        props = layout.operator("node.add_node", text=self.label, text_ctxt=default_context, icon=self.icon)
    except:
        props = layout.operator("node.add_node", text=self.label, text_ctxt=default_context)

@philstopford
Copy link
Author

Just following up on this : 2901eb7 still has the problem

@philstopford
Copy link
Author

Bumping again. Has activity ceased for the time being?

@poseidon4o
Copy link
Collaborator

@philstopford Unfortunatelly SceneCity is paid and I can't test if the changes will fix it really. Anyway I added them with 9edd2f8 test and write back when you can.

@philstopford
Copy link
Author

I'll try and build from source later this week; it looks like there are no automated builds currently being generated by ChaosGroup. I'll let you know how I get on.

@poseidon4o
Copy link
Collaborator

Builds are running now, they should appear soon in the nightlies.

@philstopford
Copy link
Author

Looks good here - thanks. Build service saved me the trouble :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants