Attribute template in Maya - scripting

I am working in Maya 2014. I have my custom attributes showing in the Channels Box. I am now trying to show my custom attributes in the Attribute Editor. I have an AETemplate file called AECamera_OrthoTemplate.mel code below:
global proc AECamera_OrthoTemplate( string $nodeName ) {
editorTemplate -beginScrollLayout ;
editorTemplate -beginLayout "Camera" -collapse 0 ;
editorTemplate -label "Always Show Frustrum" -addControl "boolAttr" ;
editorTemplate -label "Frustrum NearZ" -addControl "numAttr" ;
editorTemplate -label "Frustrum FarZ" -addControl "numAttr" ;
editorTemplate -label "Frustrum Width" -addControl "numAttr" ;
editorTemplate -label "Frustrum Height" -addControl "numAttr" ;
editorTemplate -endLayout ;
// Currently editing values on the shape object,
// so drag in the shape attributes as well
AEshapeTemplate $nodeName ;
editorTemplate -addExtraControls ;
editorTemplate -endScrollLayout ;
}
When viewing the Attribute Editor with my custom camera shape selected I see the open Camera layout with nothing inside it and the controls all appear to be placed inside the Extra Attributes layout section right at the bottom. I want to see those controls nested in the Camera section.
Any help to get me past this hurdle would be appreciated,
Thanks.

I had misunderstood the -addControl flag, it requires the name of the attribute rather than the type of control to create.
It auto-magically deduces the control type from the attribute when it is recognized.
The reason the controls were ending up in the extra attributes section is due to Maya being clever and putting any unknown attributes into this section.
Hope this is helpful to someone else.

Related

How to make text strikethrough when hovered in elm (elm-ui)?

Basically I want to make the text strikethrough when hovered. This doesn't work easily with
el [ mouseOver [Font.strike] ] (text "some text")
as it would with
el [ mouseOver [Background.color someColor] ] (text "some other text")
because Font.strike is a Attribute msg whereas Background.color is of type Attr decorative msg
Does anyone konw how to achieve described behavior with something like Font.strike?
I would also accept non elm-ui solutions if not possible otherwise.
Like you already pointed out, mouseOver requires a Attr decorative msg. It uses CSS for the hover (hence the limitations), which takes care of applying the style on mouse over and clears it on mouse out.
For the general case, we have to detect mouse over/out ourselves, using Element.Events. We also need to keep track of this state in our Model. Then we can apply the Font.strike attribute conditionally depending on the model.
We can listen for these events on an Element.el
Events.onMouseEnter Enter
:: Events.onMouseLeave Leave
:: style
, where style is either [ Font.strike ] or [], depending on the model.
Full code and working demo here: https://ellie-app.com/bNjP6CbGrLJa1

Remove button faces

Hi all.
I want to know that how can I remove two button face with a button.
I tried this:
gui: [
en: button "English" remove [en es]
es: button "Spanih" remove [en es]
]
And than I have to append new buttons.
View engine models GUI interface as a tree of objects; each node in that tree is called a face, and each field of that face is called a facet.
Two facets, parent and pane, interlink a face with its parent node and its child nodes, respectively. So, by that theory, to remove a button is to remove a button face from a pane of its parent:
view [button "Poof!" [probe select take face/parent/pane 'text]]
This, however, is a bit limited approach. The removed face is detached from View tree and can no longer be used unless you reattach the face! object with the same specification back to the pane. It might be more useful to simply disable a button, or to render it invisible for the time being. enabled? and visible? facets can achieve just that:
view [
title "Face flags example"
below
toggle "Toggle" [foo/enabled?: not foo/enabled?]
foo: button "Switch" disabled [bar/visible?: not bar/visible?]
bar: base red
]
You can adapt this approach to the task at hand. As I understand, you want to offer mutually exclusive localization options; drop-list might be a good fit for that:
view [drop-list data ["en" "es"]]
You can try this:
Red [Needs: View]
view [
en: button "English" [remove find face/parent/pane en]
es: button "Spanish" [
remove find face/parent/pane en
remove find face/parent/pane es
]
]

How to avoid "CALL SCREEN(not modal) in modal dialog box not allowed"?

I am creating a SAP Program in which there's more that 200 parameters
PARAMETERS: P_DATE type D default Sy-DATUM.
PARAMETERS: P_DATE2 type D default Sy-DATUM
.
.
.
PARAMETERS: P_DATE2 type D default Sy-DATUM
When I compile it, I got the following errormessage:
CALL SCREEN(not modal) in modal dialog box not allowed
It works if I have only about 190 parameters. It could be just some limits. Any ideas? Thank you in
Screens (dynpros) can only have 200 lines (as mentioned in the screen painter documentation). Without further positioning instructions, each PARAMETERS declaration creates a new line on the selection screen.
(Other than that, requiring 200 parameters strongly suggests a design flaw somewhere in your application. I doubt that any user will be able to make sense of the selection screen.)
Using the positioning features of the selection screen you can place more than one parameter in one line. Check the command SELECTION-SCREEN BEGIN OF LINE and SELECTION-SCREEN POSITION, more about these here.

Drupal 7 - Print PDF and Panelizer

Hi guys ,
I'm currently working on a Drupal project which use the Panelizer module by overriding the default node display. The panel for this content type is made width a lot of rules and specifications in order to display some specific content (like views) according some fields.
Now I need to print in PDF the same content that is displayed by the panelizer module but in another display (in one column ), so I cloned the display I use and rearranged it to display what I want.Then I want to use this display width the print module but I didn't managed to do that.
Any idea how can I do that ?
I just can't use the default node render, because I would miss some informations dues to the specifications used in the panel, and I can't print the panelized content because it's not the same display.
I read this thread but how can I say to the print module to use the "print" display I cloned instead of the default one ?
Any suggestions or ideas will be appreciated or if you have another idea for doing that you're welcome :)
Thank you !
In your print pdf template you can load the node then create a view with the display and finally render it : drupal_render(node_view(node_load($node->nid), "name of your display")) ;
Another way is to alter node entity info, telling that 'print' view can be panelized, i.e.
/**
* Implements hook_entity_info_alter().
*/
function mymodule_entity_info_alter(&$entity_info) {
$entity_info['node']['view modes']['print']['custom settings'] = TRUE;
...
}
After that, you go to panelizer settings of your content type(s), and set whatever you want for the print view mode

Yii activeRadioButton does not get activerecord's real value

What might be the problem? I have a activerecord in $Row. The model has a property 'id'. Then I want to show radio buttons on interface like this:
echo CHtml::activeRadioButton($Row, 'id');
and when rendered on the browser, I can see that the radio button's value is '1'. But when I do like this:
echo $Row['id'];
that shows the correct value (128).
What might be the problem?
The 'id' argument specifies what property the radio button will write to when the form is submitted. However, you need to also specify what the radio button's value will be when selected. Do this through the function's third parameter:
echo CHtml::activeRadioButton($Row, 'id', array('value' => $Row['id']));