PySide gui, Maya hypershade updates - pyside

I am new to PySide and would like to have the QT gui update based on selections made by the user in the Maya hypershade. For instance, as the user changes selected nodes in the hypershade, the names of those nodes update in my PySide gui. I have the gui listing the selected node when it is launched, but I am not sure how to dynamically update the list as the user changes their selection in Maya. Thank you.

Sounds like you need a selection callback.
With OpenMaya's api there's MEventMessage, and also scriptJob with cmds. Examples on both can be found here:
How to get from Maya event of a change highlight objects in the scene?
I suggest using MEventMessage instead of a scriptJob for performance reasons.

Related

Drag/marquee selection inside custom maya UI

Is there a way to select several buttons inside a formLayout (or any other layout) with a drag selection?
Like how you would do with maya objects in viewport, but inside a custom MEL UI
i know you can use getModifiers to know if Shift is pressed to not and thus mimick shift selection etc
but drag/marquee selection seems, very hard, to replicate...
I don't think you can use Maya's standard interface objects to achieve that, but yes, you can absolutely do it with PySide in Python.
Check out examples for QtWidgets.QGraphicsView and QtWidgets.QGraphicsScene. Their framework is setup so that you can create items inside their view, and be able to select multiple with a marquee. They can also support moving via dragging the items, so you can even go as far as having a body picker creator without having to hard-code it. You could even be fancy as to create path items with beziers handles (like Photoshop) so that the user can create their own custom shapes, though you would have to manually make that framework.

Asynchronously loading drop down menu - Flutter

I am trying to build a form with a phone input that includes country codes. Essentially, I am trying to make something a lot like this:
I already found and cleaned a list of flags, countries, and their codes, and built the method that creates a DropdownMenuItem for an arbitrary index. I then construct a list of them and pass it to the DropdownButton widget. It's all very simple, so I don't think the code is necessary. However, because I have so many countries, and therefore menu items, the menu lags significantly when opening. So, I was wondering if drop down menus are capable of loading large numbers of widgets in a smarter fashion than it seems they do.
Can a drop down menu could load the first 10 or so widgets around the selected index and display them, as that is all that will be in view initially, and then load the rest of the widgets asynchronously? I suspect that this will require a custom drop down menu, but I am not very well versed in the implementation of Flutter's drop down menu, so I am unsure of how to proceed with this.
Any help is appreciated.
I don't think that "loading" is the actual problem here, more likely it's the rendering/building of the widgets. You can improve the situation by using something like a ListView.builder that builds items on demand.
It seems like the default dropdown system is not based on a ListView.
You can create your own version of the dropdown (like a complete customized copy of the classes), which will require quite quite a lot of work and research.
Or alternatively, use something like a SimpleDialog with an embedded ListView to display the list. Like this one for Android.

How to change the size of the components list in Nsis?

I have developed an installer with Nsis with a components page in which the user can select the components to install. I would like to change the size of the component list window and make it greater in order to make visible the entire text of each component without scroll bars.
Does anybody know how I can do it? I'm using simple MUI.nsh, not MUI2.nsh.
Any help will be pleasant. Thanks in advance.
Define MUI_COMPONENTSPAGE_SMALLDESC or MUI_COMPONENTSPAGE_NODESC, if that is not enough you will need to use a custom dialog (ChangeUI)

Binding events to device context objects in wxpython

I am new to wxpython and am running into a problem. What I'd like to do is bind events to device context objects. For example, in one window I would draw a number of different device context objects (i.e. lines, rectangles, etc). First, I would like to be able to select a specific object within the window, for the purposes of linking it to a text box that names it. Second, I'd like to be able to drag the object anywhere within the window, preferably with mouse-down, mouse-move events. I know that this is possible in Tkinter's canvasses, but I can't find any equivalent method in wxpython. Any help would be appreciated.
Thanks,
David
The wxPython demo has an example of selecting objects and dragging them around. There's also the Whyteboard program that has similar functionality and it's written in wxPython too. I would check that out: https://launchpad.net/whyteboard

ESRI - Arcmap help to create a button that will populate current date for selected features

I would like to create a custom tool or button in Arcmap that programmatically fills in a number of attributes of selected features for a layer.
To keep things simple, lets say my Arcmap project only has one SDE layer, and I'd like to populate the Date_Created field.
The SDE layer being edited is versioned.
I have some code that partially works, but after the selected records are updated, the layer can no longer draw stating it's in a closed State.
link text
I appreciate any suggestions on how to accomplish this.
Thanks,
Frank
I think that this behavior may be related to management of the edit operations in your script.
Any edit operations that you start must either be stopped (completed) or aborted. If no features have been edited, the edit operation needs to be aborted.

Resources