[Maya-Python] maya Python file writing progress bar ?

2017-04-08 Thread Virbhadra Gupta
here is my code

def exportAnimation():
dataForJson = getAnimData(startFrame,endFrame)
path = cmds. internalVar (utd=True)
filePath = str (path)+'animaton.VGdata'
exportData = json.dumps ( dataForJson , sort_keys= True , 
ensure_ascii=True , indent= 2 )
File = open( filePath, 'w')
load = File.write (exportData) 

"""
Here i need to create file writing progressBar
"""
#craete progressBar
gMainProgressBar = maya.mel.eval('$tmp = $gMainProgressBar')

# need to show progress of writing 
 

File.close()



-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/5603bdc6-6781-402e-a372-8cf4fa496bb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] maya Python file writing progress bar ?

2017-04-11 Thread Virbhadra Gupta
Thank You Justin!!
now i got the point what i need to do :)
thank you for your input :)

On Sunday, April 9, 2017 at 2:57:13 AM UTC+5:30, Justin Israel wrote:
>
>
>
> On Sun, Apr 9, 2017, 1:47 AM Virbhadra Gupta  > wrote:
>
>> here is my code
>>
>> def exportAnimation():
>> dataForJson = getAnimData(startFrame,endFrame)
>> path = cmds. internalVar (utd=True)
>> filePath = str (path)+'animaton.VGdata'
>> exportData = json.dumps ( dataForJson , sort_keys= True , 
>> ensure_ascii=True , indent= 2 )
>> File = open( filePath, 'w')
>> load = File.write (exportData) 
>> 
>> """
>> Here i need to create file writing progressBar
>> """
>> #craete progressBar
>> gMainProgressBar = maya.mel.eval('$tmp = $gMainProgressBar')
>> 
>> # need to show progress of writing 
>>  
>> 
>> File.close()
>>
>
> Do you only need progress for the act of writing the file? Is the write 
> going to take a while and not the other steps? Any progress bar 
> implementation is going to need you to feed it updated progress values to 
> push it towards 100%. So if this file write really needs a progress bar 
> then you have to split the writes up into chunks. Then you loop over the 
> number of chunks, write the bytes and update the progress bar. 
>
> Is this what you meant? Or did you want progress for the entire set of 
> steps? Can you be more specific about what aspect has you stuck? 
>
>
>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to python_inside_maya+unsubscr...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/5603bdc6-6781-402e-a372-8cf4fa496bb8%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/5603bdc6-6781-402e-a372-8cf4fa496bb8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/eff6e41f-6040-470b-bb50-2b78aaa2da49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] how i can pass python variable in mel

2017-05-28 Thread Virbhadra Gupta
how i can pass python variable in mel??
in my example mel_path in not giving what is supposed to give
anims_path  is giving proper path like "D:\del\malcolm_v109_malcolm.anim"
but mel_path giving  "d:/"
please help me out.

for obj in objs:
object_name = renamer (obj)
cmds.select (obj)
anims_path = path_input+ platform_tester ()+ object_name +'.anim'
mel_path = mel.eval ('$mel_path = python("anims_path")')

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/a81a312c-72eb-4313-acfa-12ae7de19937%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: how i can pass python variable in mel

2017-05-28 Thread Virbhadra Gupta
Thanks!!!
it worked :)

On Sunday, May 28, 2017 at 1:42:26 PM UTC+5:30, Virbhadra Gupta wrote:
>
> how i can pass python variable in mel??
> in my example mel_path in not giving what is supposed to give
> anims_path  is giving proper path like "D:\del\malcolm_v109_malcolm.anim"
> but mel_path giving  "d:/"
> please help me out.
>
> for obj in objs:
> object_name = renamer (obj)
> cmds.select (obj)
> anims_path = path_input+ platform_tester ()+ object_name +'.anim'
> mel_path = mel.eval ('$mel_path = python("anims_path")')
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/dba7a825-d7f9-4317-843f-53fc09c42245%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] python list sorting issue

2017-11-05 Thread Virbhadra Gupta


i was trying to sort list by only 0 and other Numbers like [2,0,0,4] to 
[2,4,0,0]
i come up with this code but in this code variable list is changing. i am 
unable to understand why ?

list = [4,0,0,4]

def re_sort(list):
count=0
tmp_list = list
print list
for i in list:
if not i:
tmp_list.remove(i)
count+=1
print list
for n in range(count):
tmp_list.append(0)
return tmp_list
re_sort(list)


re_sort(list)
[4, 0, 0, 4]
[4, 0, 4]
# Result: [4, 0, 4, 0] # 

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/e4b95d9e-bda4-4499-9d94-860be6aaaf5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Maya mouse movement event, mouse dragging direction ?

2018-02-07 Thread Virbhadra Gupta
hey,
i creating code where we can update value by dragging mouse on maya view 
port.
i want to get mouse movement (up, down, right or left) or mouse 
cursor  anchor point.
i can query anchor point with draggerContext commant but it's gives only 
first point only.
so i am unable to know mouse dragging direction.

please let me know if my approach is right or wrong and how can we get 
mouse dragging direction.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/33a07d27-2fa4-4a8d-8529-3b9c1642cdb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Maya mouse movement event, mouse dragging direction ?

2018-02-07 Thread Virbhadra Gupta
Here is sample code. It will give first click value and keeps on giving same 
again so i am unable to know drag direction.

contx = "valueDrag"

def onDrag ():
x = cmds.dragferContext(contx, q=True, ap=True)
print x


if cmds.draggerContext(contx, q=True, ex=True):
cmd.deleteUI(contx)
cmd.draggerContext(contx, dc=onDrag, cur="tumble")
cmds.setToolTo(contx)

Result will be like on mouse drag
All anchor point will come same it give only first point of click.

(2,45,0)
(2,45,0)
(2,45,0)
(2,45,0)

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/bfde6c2b-0208-4d7b-b766-6a307fa386b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Maya mouse movement event, mouse dragging direction ?

2018-02-08 Thread Virbhadra Gupta
Thanks i got it.

On Feb 8, 2018 3:30 PM, "Justin Israel"  wrote:

>
>
> On Thu, Feb 8, 2018, 5:40 PM Virbhadra Gupta 
> wrote:
>
>> Here is sample code. It will give first click value and keeps on giving
>> same again so i am unable to know drag direction.
>>
>> contx = "valueDrag"
>>
>> def onDrag ():
>> x = cmds.dragferContext(contx, q=True, ap=True)
>>
>
> This is going to query the anchorPoint each time, which is the start point
> of the drag. You probably ly want to query the dragPoint to get the current
> position
>
> x = cmds.draggerContext(contx, q=True, dp=True)
>
> print x
>>
>>
>> if cmds.draggerContext(contx, q=True, ex=True):
>> cmd.deleteUI(contx)
>> cmd.draggerContext(contx, dc=onDrag, cur="tumble")
>> cmds.setToolTo(contx)
>> 
>> Result will be like on mouse drag
>> All anchor point will come same it give only first point of click.
>>
>> (2,45,0)
>> (2,45,0)
>> (2,45,0)
>> (2,45,0)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to python_inside_maya+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/python_inside_maya/bfde6c2b-0208-4d7b-b766-
>> 6a307fa386b6%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Python Programming for Autodesk Maya" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/python_inside_maya/VThpSpH6Fi0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/CAPGFgA05oSTOQdQXL8VPcxWu0rGbY
> MEqSiEe%2BEyCr0y98CJPzw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA05oSTOQdQXL8VPcxWu0rGbYMEqSiEe%2BEyCr0y98CJPzw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAOWdtYY1PJTSZ4aGuJZP2G4gne-OBA4z2qcGS08KZfU%2BHCncpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] How to create blinking button

2018-03-11 Thread Virbhadra Gupta
Hello i am trying to create one script to create blinking image button
I can change image with image or symbolButton command
But problem it i can use any loop like while maya will be stuck while loop is 
running
I think we can create it using scriptjob ??
If yes how can i do it plz can anyone get me reference
Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/7cf3ab01-a5bb-4164-ba52-139e8cd34b8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] How to create blinking button

2018-03-14 Thread Virbhadra Gupta
Hey this sample of my code

wid= newWin"
mode= True

cmds.window(wid)
cmds.rowLayout(nc=2, cw=(30,50)
img=cmds.image(image=circle.png)
btn=cmda.button(l="start")
cmds.showWindow(wid)

def apply():
global mode
while mode:
time.sleep(0.2)
cmds.image(img, e=True, image="circle.png")
time.sleep(0.2)
cmds.image(img, e=True, image="circlePoly.png")
if not mode:
break
t=threading.Thread(target=apply, args=())
t.start()

with this i can run separate thread in maya but this code is not updating in 
window i have tried cmds.refresh(win) still it won't work.
How can i hv blink effect with this.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/40d687be-c1af-4d97-8341-dac3d306932c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Need to create some kind of dynamic constraint ?

2018-05-21 Thread Virbhadra Gupta
Hello
I am trying to create script that will connect wheels to ground.
My approch is i am trying to connect only translation y with poly mesh.
Geometry constraint is only option.
But we can't control connection it connects all transactions attributes.

Any suggestions will be helpful.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/266f3599-3dc1-433a-ba8a-3ee18d3e98e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Need to create some kind of dynamic constraint ?

2018-05-23 Thread Virbhadra Gupta
Yes,
Something like that.
Can you hive me overview to make it.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/68835f0b-fb23-42d0-9a3b-734fa8d2c479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Need to create some kind of dynamic constraint ?

2018-05-23 Thread Virbhadra Gupta
Hey thanks
Nice idea but when i create follicle it is not following that 9 vtx face.
Can you tell me how to attach may be i am doing something wrong.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/4bb5bf7a-2858-4692-9112-6c5b4a3ed9f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Need to create some kind of dynamic constraint ?

2018-05-23 Thread Virbhadra Gupta
Yes,
Something like that.
Can you tell me overview to make it.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/4ae43086-be88-427e-b0e0-3cec453e3e3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Need to create some kind of dynamic constraint ?

2018-05-23 Thread Virbhadra Gupta
Seems bit complected, i am beginner with scripting.
can you help me to create this node or share this node ?  

On Wednesday, May 23, 2018 at 6:29:26 PM UTC+5:30, Rémi Deletrain wrote:
>
> Hi,
>
> For make this I don't use geometrie constraint. I tryed to make it with 
> this constraint but isn't a good solution. Géometry constraint don't keep 
> distance between all object if the ground isn't plane.
> So, in first, i make a basic node for use *mesh 
> /nurbsSurface
>  
> *
>  
> intersect of maya API.
>
> Ray position is your wheel position.
> Ray direction is a normal of your square with plane points are wheels 
> positions of your vehicul.
>
> After I implented some function like intersect with given distance, smooth 
> interpollation when you leave intersection (last intersect point and origin 
> point) and other...
> Now I use this node for facial intersection too like lip and theeth.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/7be15c8b-e013-43e8-accf-cfbf21a2aaec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Need to create some kind of dynamic constraint ?

2018-05-24 Thread Virbhadra Gupta
Thank you for your help
I will try to create it.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/553c6798-f5ee-43ec-9bda-bca482f0cf18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] how to Align Transform of objects without using parent constraint ?

2018-06-10 Thread Virbhadra Gupta
hey,

suppose i have to child objects child_01 & child_02 both are in 
different hierarchy.

i want to match child_02's world transform (translation & rotation) to 
child_01.

parent constraint is one option but do for lots of objects don't know it's 
a good idea or not.

Other option:

i can query child_02's world transform by xform but how can i transfer it 
to child_01
by it be done by matrix ??

i tried:

matrix_01 = cmds.xform("child_02", q=True, ws=True, m=True)
cmds.setAttr("child_01.worldMatrix", matrix_01, type="matrix")

but it's not working.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/fd7fc5a1-17ff-4dcb-926a-2070e3f0fd3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] how to Align Transform of objects without using parent constraint ?

2018-06-10 Thread Virbhadra Gupta
What if i have multiple number of parents ?
We need all parents worldinversematrix ??

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/2a7eadfa-f9b9-4e7a-818b-8c13e4f325fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] mesh contains a large number of facets Maya warning ?

2018-07-07 Thread Virbhadra Gupta
Hello,

I have create one script where i changing display mode to smooth mesh 
preview.

cmds.displaySmoothness(object, divisionsU=3, divisionsV=3, pointsWire=16, 
pointsShaded=4, polygonObject=3)

But some time maya give warning window "mesh contains a large number of 
facets..."
and maya stuck until that window is open.

so i am looking to avoid this warning.

> there is not flags of displaySmoothness or command that i can find 
to avoid it.

> i tried to find out face count of mesh and trying to know what 
is threshold (face count) when maya giving this warning.
   but with each object this count is totally change

ex:  i create polyPlane with 1 face. 
  cmds.polySmooth("polyPlane ", dv=7)
  print cmds.polyEvaluate("polyPlane ", f=True)
  result: 4096
  cmds.displaySmoothness("polyPlane ", divisionsU=3, divisionsV=3, 
pointsWire=16, pointsShaded=4, polygonObject=3)

 and

 one single model it hase more then 50,000 face and still smooth mesh 
preview works fine no warning.

Please can anyone know how can i avoid this ?

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/2fff5fc2-1220-44df-9dc1-1ada6ba8540d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Catching maya's error ?

2018-08-01 Thread Virbhadra Gupta
hello,
i have a code where i am using try and except

ex:

try:
do_something()
except:
cmds.warning("some error")

function may give some error ex: "pCube03 not found", "can't constraint 
pCube02"
how can we catch that error message and use that in except as warning.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/96dd4b77-890d-4a5c-b3a9-0c1ffa70614f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Catching maya's error ?

2018-08-01 Thread Virbhadra Gupta
Really that much simple.
Thanks!!!

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/f9d07dc4-1344-4685-a4b1-a354c57b0158%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] how to add hyperlink in text ?

2018-08-02 Thread Virbhadra Gupta
hello,

i have create a window. it has some text. i want to add hyperlink to some 
text let's www.google.com

anyone know about it ?
is it cmds.text() ?

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/2285ee9c-f7ad-4042-8489-6de05e37cb75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] how to add hyperlink in text ?

2018-08-03 Thread Virbhadra Gupta
Hey can you give any example like

cmds.text(l="hey click here.")

i need hyperlink  in click.

i actually i don't know html :(
 

On Friday, August 3, 2018 at 1:07:12 AM UTC+5:30, Justin Israel wrote:
>
>
>
> On Fri, Aug 3, 2018, 7:20 AM Virbhadra Gupta  > wrote:
>
>> hello,
>>
>> i have create a window. it has some text. i want to add hyperlink to some 
>> text let's www.google.com
>>
>> anyone know about it ?
>> is it cmds.text() ?
>>
>
>
> http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/text.html#flaghyperlink
>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to python_inside_maya+unsubscr...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/2285ee9c-f7ad-4042-8489-6de05e37cb75%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/2285ee9c-f7ad-4042-8489-6de05e37cb75%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/305e98f0-318c-4b0e-b7d6-30a7f689b483%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] how to add hyperlink in text ?

2018-08-04 Thread Virbhadra Gupta
Thanks Justin!!!

On Saturday, August 4, 2018 at 1:40:44 AM UTC+5:30, Justin Israel wrote:
>
>
>
> On Sat, Aug 4, 2018, 3:51 AM Virbhadra Gupta  > wrote:
>
>> Hey can you give any example like
>>
>> cmds.text(l="hey click here.")
>>
>> i need hyperlink  in click.
>>
>> i actually i don't know html :(
>>
>
> Google knows html for you. 
>
> Try this:
>
> cmds.text(l='http://lmgtfy.com/?q=HTML+link";>hey click 
> here.', hl=True)
>
>  
>>
>> On Friday, August 3, 2018 at 1:07:12 AM UTC+5:30, Justin Israel wrote:
>>
>>>
>>>
>>> On Fri, Aug 3, 2018, 7:20 AM Virbhadra Gupta  wrote:
>>>
>>>> hello,
>>>>
>>>> i have create a window. it has some text. i want to add hyperlink to 
>>>> some text let's www.google.com
>>>>
>>>> anyone know about it ?
>>>> is it cmds.text() ?
>>>>
>>>
>>>
>>> http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/text.html#flaghyperlink
>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Python Programming for Autodesk Maya" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to python_inside_maya+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/2285ee9c-f7ad-4042-8489-6de05e37cb75%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/2285ee9c-f7ad-4042-8489-6de05e37cb75%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to python_inside_maya+unsubscr...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/305e98f0-318c-4b0e-b7d6-30a7f689b483%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/305e98f0-318c-4b0e-b7d6-30a7f689b483%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/3ab9920e-da88-47b9-a4d5-ebebbb58d9a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: how to make a progress bar that show Maya are working on it

2018-08-06 Thread Virbhadra Gupta
First you need to import 

import maya.mel as mel

and your moveButton function will look like this

def moveButton(*args):
listItem = cmds.textScrollList( 'scrollList', q=True, si=True)
# accessing maya Main progreas bar
bar_name = mel.eval('$tmp = $gMainProgressBar')
# creating bar
cmds.progressBar(bar_name, e=True, bp=True, ii=True, status='"Your 
Message...', max=len(listItem))
barCount=0
for item in listItem:
episode = item.split('_')[1]
scene = item.split('_')[2]
shots = item.split('_')[3]
phase = item.split('_')[4]
finalpath =  'B:/PROJECT/JTM03/' + episode + '/' + 
phase.split('.')[0] + '/'
newFileName = 'JT_' + episode + '_' + scene + '_shot' + 
shots.split('SH')[1] + '_ani.ma'
srcfile = finalpath + item
dstdir = 'V:/J_Team/3D/Shots/' + episode + '/' + scene + '/shot'+ 
shots.split('SH')[1] + '/'
finaldst = 'V:/J_Team/3D/Shots/' + episode + '/' + scene + '/shot'+ 
shots.split('SH')[1] + '/' + newFileName
if not os.path.exists(dstdir):
os.makedirs(dstdir)
shutil.copy2(srcfile, finaldst) 
# adding progress in bar
cmds.progressBar(bar_name, edit=True, step=barCount)
barCount+=1
# Ending bar
cmds.progressBar(bar_name, edit=True, endProgress=True)


On Monday, August 6, 2018 at 5:16:16 PM UTC+5:30, Yoga Yasahardja wrote:
>
>
> Hi, so I'm new to maya python and have created a tools that when I pressed 
> the button, that will copy files to destination. 
> As for more practice and make it cool, I want to create a progress bar 
> when maya doing this work. This things also can let people clear wheter the 
> job has been finished or not. 
> I don't get how the cmds.progressBar work for this things, and how to put 
> it. Some enlighten would be very appreciated. :) 
>
> I also didn't get what is this and how to use it (found in this forum) : 
> gMainProgressBar = maya.mel.eval('$tmp = $gMainProgressBar')
>
> Because that's leads me to nothing. 
>
> This is a copy of my script. 
>
>
> --
>
>
> import maya.cmds as cmds
> import os
> import shutil
>
> if cmds.window('fileMover', exists=True):
> cmds.deleteUI('fileMover', window=True)
>
> folder = os.listdir("B:/PROJECT/JTM03")
> ep = []
>
> for item in folder:
> if len(item) <= 6:
> ep.append(item)
>
> def moveButton(*args):
> listItem = cmds.textScrollList( 'scrollList', q=True, si=True)
> for item in listItem:
> episode = item.split('_')[1]
> scene = item.split('_')[2]
> shots = item.split('_')[3]
> phase = item.split('_')[4]
> finalpath =  'B:/PROJECT/JTM03/' + episode + '/' + 
> phase.split('.')[0] + '/'
> newFileName = 'JT_' + episode + '_' + scene + '_shot' + 
> shots.split('SH')[1] + '_ani.ma'
> srcfile = finalpath + item
> dstdir = 'V:/J_Team/3D/Shots/' + episode + '/' + scene + '/shot'+ 
> shots.split('SH')[1] + '/'
> finaldst = 'V:/J_Team/3D/Shots/' + episode + '/' + scene + 
> '/shot'+ shots.split('SH')[1] + '/' + newFileName
> if not os.path.exists(dstdir):
> os.makedirs(dstdir)
> shutil.copy2(srcfile, finaldst) 
>
>
> def printMenu( episodes ):
> if cmds.textScrollList('scrollList', exists=True):
> cmds.deleteUI('scrollList', control=True)
> epFolder = []
> directory = os.listdir("B:/PROJECT/JTM03/"+str(episodes)+"/ANM")
> for file in directory:
> if file.endswith(".ma"):
> epFolder.append(file)
> 
> cmds.textScrollList( 'scrollList', append=epFolder, ams=True, w=300)
> if cmds.button('moveButton', exists=True):
> cmds.deleteUI('moveButton', control=True)
> cmds.button('moveButton', label='MOVE TO CLIENT FOLDER', w=300, h=50, 
> c=moveButton)
>
> #WINDOW 
> window = cmds.window('fileMover', title='FILE MOVER', sizeable=False)
> cmds.columnLayout()
> cmds.optionMenu( label='   EPISODES  ', changeCommand=printMenu, w=300, 
> h=40 )
> ##dropdown menu
> for i in range(0,len(ep)):
> cmds.menuItem( label = ep[i] ) 
>
> cmds.showWindow( window )
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/b30e50a3-0f8a-40cb-b4d7-e5a96e685af9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: how to make a progress bar that show Maya are working on it

2018-08-06 Thread Virbhadra Gupta
Sure buddy i just give you example how you can use it.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/db54bb44-82d8-45b0-a074-3c5bd798d0b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Parent Constraint Issue when removing constraint

2018-09-11 Thread Virbhadra Gupta


Hello, i am trying to remove parent constraint using parentConstraint 
command.

but constraint created by skipping any Tran or Rot attrs 
cmds.parentConstraint(obj1, obj2, rm=True) won't work why ??

am i doing something wrong ??

here is sample code and error:

# Creating two objects
box1 = cmds.polyCube(n="box_01")[0]
box2 = cmds.polyCube(n="box_02")[0]

# Creating parent Constraint only for Translation
cmds.parentConstraint(box1, box2, mo=True, sr=["x","y","z"])

# checking if "box_02" have parent constrint
consObj =  cmds.parentConstraint(box1, q=True, tl=True)

# removing constraint
cmds.parentConstraint(consObj[0], box2, rm=True)

###

#Error: RuntimeError: file  line 1: Cannot edit object with no 
constraint. 

 

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/54026507-c7d7-46d0-a33e-7aba0909347f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] selection based marking menus ?

2018-09-20 Thread Virbhadra Gupta
Hello,
I want to create selection based marking menus.
It should check selection name and based on that marking menu should come.
Any idea how to create ?

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/200de78b-f9a6-4c0d-8510-a279e31b5df0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.